This is the mail archive of the
mailing list for the Cygwin project.
RE: Perl package File::Spec confused under cygwin
- From: "linda w \(cyg\)" <cygwin at tlinx dot org>
- To: <cygwin at cygwin dot com>
- Date: Sat, 21 Dec 2002 17:36:58 -0800
- Subject: RE: Perl package File::Spec confused under cygwin
> Note that Cygwin, like Unix, doesn't have a concept of
> volume. Everything except network paths (//host/dir) are
> based on a single root directory.
But Unix does have a concept of a mount point (device) and
path from the mount point. Conceivably, one could view the
mount point itself as a local host name for the "volume" (local, remote or a
device) with path being location on the mounted fs.
It is arbitrary to choose to see the /fs as one giant undifferentiated
I would argue that it is certainly not only in line with the
existing specification, but may also provide useful information to
return the volume path split out from the path within the volume.
Theoretically, if people have followed the spec for FILE::Spec,
to reconstitute a deconstituted path, they shouldn't assume volume
is non-zero (hardly a good assumption if what you are interested in is
> Mixed file specifications like c:/x/y/z are handled by many
> programs in the Cygwin environment, but such paths are not
> really valid. File::Spec::Win32 accepts '/' as well as '\'
> as a directory separator.
That makes sense as there used to be environment or config.sys option,
'SWITCHCHAR', that you could specify the switch char as '-'
instead of '/', with the result that '/' was treated the same as '\' as a
> That's exactly the situation. File::Spec::Cygwin for Perl
> 5.8 only overrides file_name_is_absolute() and canonpath();
> other than that it's pure File::Spec::Unix. I'm sure the
> Perl Porters would be willing to examine a patch to handle
> mixed specs.
Ah...so there is a separate Cygwin...guess that answers one
> You can always call File::Spec::Win32 -> splitpath() to get
> that behavior.
Well, for 'portability' one shouldn't call ::<OS> anything.
The purpose of File::Spec was to provide a OS independent way to
deconstruct/construct pathnames into their separate components.
> It does, but File::Spec::Cygwin is very close to File::Spec::Unix.
Yeah...got that. I guess most immediate fix would be to fix
the Cygwin version to differentiate things... then if it was
important, one could split the path to mount:path for more useful, yet
Didn't know Cygwin had it's own module...thanks!
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html