From agalakhov at ifmlrs.uran.ru  Wed Jun 15 12:37:00 2005
From: agalakhov at ifmlrs.uran.ru (agalakhov@ifmlrs.uran.ru)
Date: Wed, 15 Jun 2005 12:37:00 +0200 (CEST)
Subject: [Rd] source() chdir does not work (PR#7940)
Message-ID: <20050615103700.C23F2A1F9@slim.kubism.ku.dk>

Full_Name: Alex Galakhov
Version: 2.1.0
OS: Linux (Debian)
Submission from: (NULL) (195.19.131.68)


After software upgrade source() does not work properly anymore. It completely
ignores the chdir= parameter. This is because is.character(file) is always false
after the assignment file<-file(file).

The fix is (written by hand in diff-like syntax, hopefully, you'll understand
it):

 source<- function (blablabla) {
+filename <- file
...blablabla
-if (chdir && is.character (file) && ... dirname(file) ...) {
+if (chdir && is.character (filename) && ... dirname(filename) ...) {
+close(file) # since we can have only one on.exit(), we close file here
...blablabla
 on.exit(setwd(owd));
 }



[Rd] source() chdir does not work (PR#7940)
agalakhov@ifmlrs.uran.ru