Re: [Rd] unlink fails to remove symbolic links

2009-03-21 Thread Prof Brian Ripley
On Sat, 21 Mar 2009, Martin Morgan wrote: A little more precisely, unlink fails when the file being unlinked is a broken symbolic link (as in the example below). This is because R_FileExists checks stat() == 0, and stat fails (returns -1) when trying to resolve the broken link. Perhaps lstat() i

Re: [Rd] unlink fails to remove symbolic links

2009-03-21 Thread Martin Morgan
A little more precisely, unlink fails when the file being unlinked is a broken symbolic link (as in the example below). This is because R_FileExists checks stat() == 0, and stat fails (returns -1) when trying to resolve the broken link. Perhaps lstat() is more appropriate? Martin Martin Morgan w

[Rd] unlink fails to remove symbolic links

2009-03-21 Thread Martin Morgan
unlink fails to remove symbolic links. This is more prominent now -- when a package creates symbolic links during installation, 00LOCK is not removed. Martin > setwd(tempdir()) > fl <- tempfile(); file.create(fl) [1] TRUE > lnFile <- tempfile(); system(paste("ln -s", fl, lnFile)) > list.files() [