bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: {base,dir}name // semantics


From: Eric Blake
Subject: Re: {base,dir}name // semantics
Date: Mon, 11 Jul 2005 20:59:37 +0000

> > POSIX allows implementations to define the behavior of 'basename //' and
> > 'dirname //'.  Currently, both operations in coreutils output a single /, 
> > but
> > this definition is worthless on platforms (like cygwin) where // is distinct
> > from /.  The intent, according to POSIX, is that 'cd $(dirname "string")
> > && stat $(basename "string")' access the same file as 'stat "string"'
> > would do.
> 
> Might this also be a problem for mkdir?  And perhaps cp?

CVS has already been updated to account for this for `mkdir -p'.
cp does not do any filename munging (so if you type //foo at the
command line, "//foo" is passed to the OS).  There are probably
some other gotchas to discover; for example, I just realized that
`rm --preserve-root -R //' probably doesn't do what it should.
If you see any others, point them out!

--
Eric Blake






reply via email to

[Prev in Thread] Current Thread [Next in Thread]