This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Perl package File::Spec confused under cygwin


On Sat, 21 Dec 2002 17:36:58 -0800 "linda w (cyg)" <cygwin@tlinx.org> wrote:

>> 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.

device != volume.  For the purposes of File::Spec, it would be better to
leave the directory structure as a single tree.

> It is arbitrary to choose to see the /fs as one giant undifferentiated
> tree.

But that is the convention used by Unix and hence Cygwin.  You can
distinguish which device a file or directory is in by using the first
element returned by stat(), but that doesn't affect the file spec.

>> 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.

Portability is a worthy goal, but sometimes you have to accomodate your
specific environment, that's why $^O is available.

>> 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
> spec-compatible functionality.

If you submit a Perl bug report with a patch that does what you want and
explains why you want it, it is likely to get included in the next release
of Perl.  If you talk nice to Gerrit, you may even get it in the next build
of Cygwin Perl pending a change to the base source.  Borrowed code from
File/Spec/Win32.pm may provide a start.

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]