> OK, thanks. I still haven't got any answer to my original question,
> though. I.e., is there some way to know what text the
> filename is, or do I have to make a more or less wild guess what
> encoding the program that created the file used?

You have to guess.  As far as I know, Apple's HFS (and HFS+) is the only file 
system which stores the encoding along with the filename.  NFS doesn't provide 
a mechanism to send the encoding with the filename; I don't believe that CIFS 
does, either.

If you're writing the application, you could store the encoding as an extended 
attribute of the file. This would be useful, for instance, for an AFP server.

> > The trick is that in order to support such things as
> > casesensitivity=false for CIFS, the OS needs to know what characters
> > are uppercase vs lowercase, which means it needs to know about
> > encodings, and reject codepoints which cannot be classified as
> > uppercase vs lowercase.
> 
> I don't see why the OS would care about that. Isn't that the job of the
> CIFS daemon?

The CIFS daemon can do it, but it would require that the daemon cache the whole 
directory in memory (at least, to get reasonable efficiency). This doesn't work 
so well for large directories. If you leave it up to the CIFS daemon, you also 
wind up with problems if you have a single sharepoint shared between local 
users, NFS & CIFS -- the NFS client can create two files named "a" and "A", but 
the CIFS client can only see one of those.

> As a matter of fact I don't see why the OS would need to
> know how to decode any filename-bytes to text.
> However, I firmly believe that user applications should have that
> opportunity. If the encoding of filenames is not known (explicitly or
> implicitly) then applications don't have that opportunity.

Yes -- that's why Apple includes an encoding byte in both HFS and HFS+.  (In 
HFS+, filenames are normalized to 16-bit Unicode, but the encoding is still 
useful in choosing how to recompose the characters, and in providing hints for 
applications which prefer the names in some 8-bit encoding.)

-- Anton
 
 
This message posted from opensolaris.org
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to