FileDirectory>>fileExists: (was: Re: [BUG]Unable to load BFAV,
various problems )
Ned Konz
ned at bike-nomad.com
Thu Apr 22 21:55:55 UTC 2004
On Thursday 22 April 2004 1:10 pm, Colin Putney wrote:
> Lets assume that the file system is hierarchical. (We don't currently
> support any that aren't, do we?) File could contain an isAbsolute flag,
> and an array of tokens. The peer for the current filesystem would take
> those tokens and do some kind of platform-specific resolution.
I don't think it's that simple. I believe that's what Java does, and I don't
think it ensures portability.
I have a Perl module (Archive::Zip) on CPAN, and I've had to deal with
filename mapping problems on several platforms. It's not easy. As you recall,
filenames are stored in a canonical but poorly-specified format in Zip files;
they use forward slashes as directory separators but it's otherwise not well
defined what they can consist of.
For the Mac (HFS) and Windows platforms I had to add some knowledge of
volumes; these don't necessarily work like ordinary path components. That is,
you may need to know where the mount points are (and possibly about volume
aliasing as well if you have a file system like the Amiga OS). Some file
operations work differently across volume boundaries, and it's also possible
(I think) to have a combination of file systems with different rules mounted
into a single namespace.
For instance, I use Samba to serve files from my Linux box, and also use
SMB/CIFS to share files from my Windows and Mac machines. But these three
worlds have different file naming rules and could have different handling of
names (maximum length, allowed characters, NLS/character encoding, case
sensitivity, case preservation) as well as other incompatible
characteristics.
I looked at a number of filename handling libraries in other languages back in
August 2002 and didn't find any I was happy with. Maybe someone else knows of
something better.
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|