Skip to content

Construct a File Path: File Path Unknown

7 messages · Tyler Rinker, Jean V Adams, William Dunlap +2 more

#
Try using normalizePath("foo.pdf") after creating
the file.  It should return an absolute path to
an existing file.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
#
it would probably be faster if you can be as specific as possible... in the
help that has been provided, it is looking everywhere in  c:/    

you could narrow that down a bit and save it from looking too deep in your
system.

dir("C:\Documents and Settings\username\Desktop", pattern="foo.pdf",
full.names=T, ignore.case=T, recursive=T)

**I'm not 100% about this, but it seems logical to me
William Dunlap wrote:
--
View this message in context: http://r.789695.n4.nabble.com/Construct-a-File-Path-File-Path-Unknown-tp3768821p3769392.html
Sent from the R help mailing list archive at Nabble.com.
#
If you create a directory to work in for your project you could store that
and use that later
maindir<-getwd()
#then even if you change directories for different parts of your project
(but remain inside that folder)
 you could put maindir variable into the path of the dir command. The less
directories you have to scan through, the faster your answer.

dir(maindir, pattern="foo.pdf", full.names=T, ignore.case=T, recursive=T) 




--
View this message in context: http://r.789695.n4.nabble.com/Construct-a-File-Path-File-Path-Unknown-tp3768821p3769397.html
Sent from the R help mailing list archive at Nabble.com.