Perl package File::Spec confused under cygwin
linda w (cyg)
Sat Dec 21 19:37:00 GMT 2002
> 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
More information about the Cygwin