2.4b FileDirectory>>fileExists:

Stephen Travis Pope stp at create.ucsb.edu
Fri Apr 30 17:18:35 UTC 1999


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