On Tue, Jul 28, 2009 at 12:36 PM, Ted Harding<ted.hard...@manchester.ac.uk> wrote:
> However, this got me looking into '?list.files, and I see there > (R version 2.9.0 (2009-04-17)): > > recursive: logical. Should the listing recurse into directories? > > But: > > Directories are included only if 'recursive = FALSE'. > > Surely the latter is the wrong way round, and should be > > Directories are included only if 'recursive = TRUE'. > by 'included' it means 'returned'. If you do 'recursive=TRUE' it scans recursively for files and only files. If you do "recursive=FALSE" it returns files and directories in the specified directory. Makes it tricky to figure out a complete directory tree since empty directories won't appear at all if recursive=TRUE. You'd have to implement your own recursive search based on list.files(d,recursive=FALSE) and then testing for directoriness.... Sucky, unless there's a better way... Barry ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.