Skip to content

file.access() on network (mounted) drive on Windows Vista?

2 messages · Brian Ripley, Henrik Bengtsson

#
It is a 'feature' of Windows Vista.  Why not just use tryCatch()?
The older version of file.access() used to report access when there was 
none, so the error have happened both ways.

(I think any OS with multiple filesystems potentially has problems like 
this: we saw them with Unix (Solaris) file systems mounted on MacOS X via 
Samba, even when the same thing works correctly on Linux.)
On Wed, 26 Nov 2008, Henrik Bengtsson wrote:

            

  
    
#
Hi,

thank you very much for this information.  I now know that it is safer
to use tryCatch() to test for this.

Details: I have a function pn <- getReadablePathname(pn) that I use to
assess that a pathname (which also follows Windows Shortcuts) passed
to a function specifies a file that exists and that can be read.  If
not, it throws an exception.  I only need to update this function to
try to open the file for reading ("rb") and then try to read a raw
byte (for an even more trusted result).  If this fails, I conclude
that the file is not a readable pathname.  I also have an analogus
getWritablePathname().

/Henrik
On Mon, Dec 1, 2008 at 4:44 AM, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote: