2.4b FileDirectory>>fileExists:

Lex Spoon lex at cc.gatech.edu
Fri Apr 30 14:15:09 UTC 1999


If you mount a regular DOS partition on Linux, without long file names, then files on the DOS partition are case insensitive.  I just tried "cat Autoexec.bat" and "cat autoexec.bat" and they both did the same thing.  The non-DOS partitions are still case sensitive as is usual for *nix.

Granted it's an unusual case, but it suggests at the least that isCaseSensitive should be specific to FileDirectory instances, and not the entire *FileDirectory class.

Or maybe there shouldjust be a fileExists: primitive made and the issue deferred to the OS.


Lex


Stephen Travis Pope <stp at create.ucsb.edu> wrote:
> 
> Lex Spoon wrote:
> > 
> > Unix uses case-sensitive filenames.  It's one of those religious debates as to which way is "better".  But there are ways to make Squeak work the right way on each operating system.  The best, IMHO, is to have a "file exists" primitive.  
> 
> I'd prefer a method that returns whether or not the current platform is
> case-sensitive; how about the following:
> 
> !FileDirectory class methodsFor: 'platform specific'!
> isCaseSensitive
> 	"Answer whether the current platfor is case-sensitive about file
> names."
> 
> 	^DirectoryClass isCaseSensitive! !
> 
> The directory classes (Mac/Dos/UNIX) can then answer differently, and
> application code can call this to be "smart" about handling file name
> clashes or file-not-found errors.
> 
> -- 
> stp
> 
> Stephen Travis Pope | stp at create.ucsb.edu |
> http://www.create.ucsb.edu/~stp





More information about the Squeak-dev mailing list