I see the default behavior of unlink with respect to directories is changing in 1.2. This causes me a certain amount of difficulty: since the recursive argument is not supported in S I will need to start building up my compatibility library again (which is almost empty now). Instead of changing unlink's default behavior it might be better to define a new function (perhaps Sys.rm) with the new default behavior, and possibly even depreciate unlink. Paul Gilbert -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 10 Oct 2000, Paul Gilbert wrote:> I see the default behavior of unlink with respect to directories is changing in > 1.2. This causes me a certain amount of difficulty: since the recursive argument > is not supported in S I will need to start building up my compatibility library > again (which is almost empty now). > > Instead of changing unlink's default behavior it might be better to define a new > function (perhaps Sys.rm) with the new default behavior, and possibly even > depreciate unlink.I think you have misunderstood what unlink() was and is actually documented to do. For example: S-PLUS 3.4: Deletes the file represented by x. with no mention of recursively removing directories. Only some Unix versions of S-PLUS 3.x did: no Windows version of S-PLUS ever has. S-PLUS 5.1: unlink will remove files and directories, but only empty directories. Use rmdir to remove a directory and everything in it. (BTW, that's not actually true, but it is what is documented.) R for Windows: unlink deleted files and empty directories in recent versions, only files in earlier ones. Given the last, the default behaviour of unlink under R is not what you claim, so I suppose that your code is not fully R-compatible under 1.1.1? -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>R for Windows:>unlink deleted files and empty directories in recent versions, only files >in earlier ones.>Given the last, the default behaviour of unlink under R is not what you >claim, so I suppose that your code is not fully R-compatible under 1.1.1?Actually, I was just going by what R prior to 1.2 does in Solaris (i.e. delete directories, empty or not) and what the R 1.2 documentation says: Note Prior to R version 1.2.0 the default on Unix was recursive = TRUE, and on Windows wmpty (sic) directories could be deleted. In any case, the behavior of unlink seems to be inconsistent in various versions of S and R and on different platforms. In this situation it is very difficult to program with the function and I have usually found that it is better to define a good new function, try to make it consistent across platforms, and depreciate the old function. I will do at least an S version of that in my compatability library but I think it would be good for R if it were done in the base. Don't you think Sys.rm would be a good name? Paul Gilbert -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._