OO filename abstraction module?

2007-04-27 Thread Eric Wilhelm
I'm thinking of using a filename as a unique identifier and I'm 
wondering if there is a module on CPAN (in those 1483 search results) 
that I can't seem to find which provides some kind of OO filename 
abstraction.

Consider the (0 == 26) problem with windows and the default mac 
filesystems, plus the \\ eq / issue on windows.

  for(C:/foo, C:/Foo C:\\Foo, c:\\foo) {
chdir($_);
warn Cwd::cwd();
  }

I need to somehow canonicalize the filename without assuming that 
everything is on the same filesystem or whether the file is even there, 
etc.  Is that asking too much?  Maybe there's not a great answer to 
that, particularly when one considers a dos fs mounted on a linux box, 
etc.

Being able to compare filename objects might be nice.  Is there anything 
besides File::Spec and Cwd?

Thanks,
Eric
-- 
I've often gotten the feeling that the only people who have learned
from computer assisted instruction are the authors.
--Ben Schneiderman
---
http://scratchcomputing.com
---


Re: OO filename abstraction module?

2007-04-27 Thread Chris Dolan

On Apr 27, 2007, at 11:14 PM, Eric Wilhelm wrote:


I'm thinking of using a filename as a unique identifier and I'm
wondering if there is a module on CPAN (in those 1483 search results)
that I can't seem to find which provides some kind of OO filename
abstraction.


Try this:
  http://search.cpan.org/dist/Path-Class/
It has a very intuitive API and is based on File::Spec.  And it's  
written by Ken Williams, so it must be good.  :-)


Chris

--
Chris Dolan, Equilibrious LLC, http://equilibrious.net/
Public key: http://chrisdolan.net/public.key
vCard: http://chrisdolan.net/ChrisDolan.vcf