[Rd] unlink in 1.2
Prof Brian D Ripley
ripley@stats.ox.ac.uk
Tue, 10 Oct 2000 19:01:05 +0100 (BST)
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._