From kleiweg at let.rug.nl  Tue Nov 25 13:29:50 2003
From: kleiweg at let.rug.nl (Peter Kleiweg)
Date: Tue Nov 25 13:28:34 2003
Subject: [Rd] Question about Unix file paths
In-Reply-To: <peh6sv41hpuo8ucnuo7jgocgjb0giugimf@4ax.com>
Message-ID: <Pine.LNX.4.44.0311251324140.1390-100000@kleigh.nl>

# aldus Duncan Murdoch :

> On Tue, 25 Nov 2003 07:35:57 +0000 (GMT), you wrote:
>
>
> >I think there are some potential issues with doubling separators and final
> >separators on dirs.  On Unix file systems /part1//part2 and /path/to/dir/
> >are valid.  However, file systems on Unix may not be Unix file systems:
> >examples are earlier MacOS systems on MacOS X and mounted Windows and
> >Novell systems on Linux.  I would not want to assume that all of these
> >combinations worked.
>
> This is something that R could not do reliably by itself.  The code I
> committed checks the final character in the path, and if it's "/", "\"
> or ":" doesn't add a path separator.  However, both "C:" and "C:\" are
> valid directory names in standard Unix file systems, so the test would
> do the wrong thing there.

I think you should test for OS ( R.Version()$os )

The special meaning of "c:file" on Windows does not exist on
Unix, even if the filesystem is on a mounted Windows partition.


-- 
Peter Kleiweg
http://www.let.rug.nl/~kleiweg/


[Rd] Question about Unix file paths
Peter Kleiweg