From p.dalgaard at biostat.ku.dk  Mon Nov 24 13:32:17 2003
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Mon Nov 24 13:23:26 2003
Subject: [Rd] Question about Unix file paths
In-Reply-To: <ils3svsfa9rt1725lb9mt42d0gc63pq8ba@4ax.com>
References: <ils3svsfa9rt1725lb9mt42d0gc63pq8ba@4ax.com>
Message-ID: <x2znemc5gu.fsf@biostat.ku.dk>

Duncan Murdoch <dmurdoch@pair.com> writes:

> Gabor Grothendieck pointed out a bug to me in list.files(...,
> full.name=TRUE), that essentially comes down to the fact that in
> Windows it's not always valid to add a path separator (slash or
> backslash) between a path specifier and a filename.  For example,
> 
> c:foo
> 
> is different from
> 
> c:\foo
> 
> and there are other examples.
> 
> I'm going to fix this, but I'm wondering whether the fix is needed
> just for Windows, or for Unix too.  Specifically:
> 
> In Unix-like systems, is it *always* safe to add a slash between a
> pathname and a filename?
> 
> The only examples I can think of that might go wrong are things like
> 
> //foo
> 
> /tmp//foo
> 
> Are these the same as
> 
> /foo
> 
> and
> 
> /tmp/foo?  Are there any examples where an extra slash causes trouble?

Also, and of course, if the first part is empty, foo and /foo are very
different. There could be a problem with leading //, or is that
Windows only?

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] Question about Unix file paths
Peter Dalgaard