SPUG: getting filesystem info? (a la File::Spec)

Matt Tucker tuck at whistlingfish.net
Tue Nov 20 13:09:03 CST 2001

-- dancerboy <dancerboy at strangelight.com> spake thusly:

> File::Spec does some of this, but not all.  I'd also like to do this
> in a more platform-independent way than File::Spec (i.e., as much as
> possible, I'd like the module to figure these things by directly
> querying the OS/filesystem, rather than relying on a database of how
> different OS's "should" behave.  For one thing, remote volumes may
> not behave as expected based on the local OS's filesystem
> conventions.)

I'm not sure I really see the value in this. You're going to take a
performance hit because you'll have to figure this out every single
time you start up, and if you want to properly deal with remote volumes
you'll take the hit again every time you write to a different directory.

Also, some of what you're trying to figure out seems difficult or
impossible to do in a platform independent way. For instance, how could
you figure out the various functionality of updir on Dos/Windows vs.
Mac without some preconceived notions about their existence? And if you
program in knowledge of behavior like that, why bother trying to figure
it out on the fly?

I would say that your development efforts would be better spent adding
functionality to File::Spec, rather than writing another module that
does the same thing in a different way. In addition to the added
knowledge you're proposing (legal filename characters, etc.), you could
add a feature that tests each assumption against the current filesystem
(or even specified directory) to determine empirically whether the
assumptions are correct. That way, the performance hit is only incurred
for those who want it, and it's optimized as well.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/

More information about the spug-list mailing list