Bugzilla – Bug 14826
srcfilecopy does not save wd
Last modified: 2012-02-27 21:11:29 UTC
In contrast to 'srcfile', 'srcfilecopy' does not save the working directory in 'wd'. So it is hard to find the original file later, if it was specified by a relative path.
'srcfilecopy' is used for example in the 'source' function.
srcfilecopy() can also get its text from something that is not a file, and the debugger should not go looking in some directory in that case.
I've fixed this in R-devel by adding the working directory as requested, and also adding an argument "isFile" and a field to the result to record whether the source is known to come from a file. If isFile = TRUE, the debugger should be able to trust that the filename and wd fields really correspond to the source file; if not, they probably don't -- there may be no actual source file, or it may have a different name, and we've just got the name of a connection that read it.