ligges@statistik.uni-dortmund.de
2004-Jul-16 19:23 UTC
[Rd] (PR#7100) and #7102: list.files fails with all.files = TRUE
rpeng@jhsph.edu wrote:> I get different behavior on Linux: > > system("mkdir newdir") > dir("newdir", all.files = TRUE, recursive = TRUE) ## R hangsThe point is that all.files=TRUE implies returning also "." and ".."! Hence the recursion uses to be infinite (from "." to "." to "." ......). If recursiv = TRUE, the function should never look into "." and "..", except of the first step of the recursion. Uwe Ligges> ## After hitting Ctrl-C > There were 50 or more warnings (use warnings() to see the first 50) > > dir("newdir", all.files = TRUE, recursive = TRUE) > character(0) > Warning message: > list.files: newdir is not a readable directory > > After hitting Ctrl-C the first time, dir() doesn't hang but it > produces the warning. > > > version > _ > platform i686-pc-linux-gnu > arch i686 > os linux-gnu > system i686, linux-gnu > status > major 1 > minor 9.1 > year 2004 > month 06 > day 21 > language R > > -roger > > > joehl@gmx.de wrote: > >>>list.files("c:/tmp", all.files = TRUE, recursive = TRUE) >> >>Error in list.files("c:/tmp", all.files = TRUE, recursive = TRUE) : >> directory/folder path name too long >> >> >> >>>version >> >> _ >>platform i386-pc-mingw32 >>arch i386 >>os mingw32 >>system i386, mingw32 >>status >>major 1 >>minor 9.1 >>year 2004 >>month 06 >>day 21 >>language R >> >> >>Best >> >> >>Jens Oehlschl?gel >> >>______________________________________________ >>R-devel@stat.math.ethz.ch mailing list >>https://www.stat.math.ethz.ch/mailman/listinfo/r-devel >> > > > ______________________________________________ > R-devel@stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
dmurdoch@pair.com
2004-Jul-16 20:47 UTC
[Rd] (PR#7100) and #7102: list.files fails with all.files = TRUE
On Fri, 16 Jul 2004 19:23:21 +0200 (CEST), ligges@statistik.uni-dortmund.de wrote :>rpeng@jhsph.edu wrote: > >> I get different behavior on Linux: >> >> system("mkdir newdir") >> dir("newdir", all.files = TRUE, recursive = TRUE) ## R hangs > >The point is that all.files=TRUE implies returning also "." and ".."! >Hence the recursion uses to be infinite (from "." to "." to "." ......). > >If recursiv = TRUE, the function should never look into "." and "..", >except of the first step of the recursion.I'll fix this in r-patched. It may be a few days before I'm able to commit the change, though. Duncan Murdoch