[Pharo-project] FileDirectory default is wrong in MacOS
Hi. The simplest way to find the problem (if my case it was muuuch more than this), I found the following: MacOS is case insensitive (I've just figure it out). Since it is a UNIX at the end, I thought it was case sensitive, but it seems it is not. Now, suppose that in the directory where my image is, I have the file called 'zaraza'. If I evaluate this: (FileDirectory default fileOrDirectoryExists: 'zaraza') ->>>> true I should get true. And the same with: (FileDirectory default fileOrDirectoryExists: 'ZARAZA') ->>>> false But....I get false instead of true. Which is wrong in Mac OS. The problem is that FileDirectory default -----> UnixFileDirectory And this is because FileDirectory class >> activeDirectoryClass "Return the concrete FileDirectory subclass for the platform on which we are currently running." FileDirectory allSubclasses do: [:class | class isActiveDirectoryClass ifTrue: [^ class]]. that loop answers UnixFileDirectory. This is because: nixFileDirectory class >> isActiveDirectoryClass "Does this class claim to be that properly active subclass of FileDirectory for this platform? Default test is whether the primPathNameDelimiter matches the one for this class. Other tests are possible" ^self pathNameDelimiter = self primPathNameDelimiter answers true. But anyway, why MacFileDirectory class >> isActiveDirectoryClass answers false? If we see: MacFileDirectory class >> isActiveDirectoryClass ^ super isActiveDirectoryClass and: [(Smalltalk getSystemAttribute: 1201) isNil or: [(Smalltalk getSystemAttribute: 1201) asNumber <= 31]] (Smalltalk getSystemAttribute: 1201 -> '255' So.....my questions are: 1) Should it answer Unix one, or MacOS? I guess than MacOS, and if it is unix, then we have to solve the kind of problem I have 2) Why (Smalltalk getSystemAttribute: 1201 -> '255' 3) Why not using "Smalltalk platformName" to detect which FileDirectory to use?? Thanks Mariano
On Sun, Nov 21, 2010 at 3:44 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
Hi. The simplest way to find the problem (if my case it was muuuch more than this), I found the following: MacOS is case insensitive (I've just figure it out).
Actually no. It can be either. You can choose. Mine is case-sensitive.
Since it is a UNIX at the end, I thought it was case sensitive, but it seems it is not. Now, suppose that in the directory where my image is, I have the file called 'zaraza'. If I evaluate this:
(FileDirectory default fileOrDirectoryExists: 'zaraza') ->>>> true
I should get true. And the same with:
(FileDirectory default fileOrDirectoryExists: 'ZARAZA') ->>>> false
But....I get false instead of true. Which is wrong in Mac OS. The problem is that FileDirectory default -----> UnixFileDirectory
And this is because
FileDirectory class >> activeDirectoryClass "Return the concrete FileDirectory subclass for the platform on which we are currently running."
FileDirectory allSubclasses do: [:class | class isActiveDirectoryClass ifTrue: [^ class]].
that loop answers UnixFileDirectory. This is because:
nixFileDirectory class >> isActiveDirectoryClass "Does this class claim to be that properly active subclass of FileDirectory for this platform? Default test is whether the primPathNameDelimiter matches the one for this class. Other tests are possible"
^self pathNameDelimiter = self primPathNameDelimiter
answers true.
But anyway, why MacFileDirectory class >> isActiveDirectoryClass answers false?
If we see:
MacFileDirectory class >> isActiveDirectoryClass ^ super isActiveDirectoryClass and: [(Smalltalk getSystemAttribute: 1201) isNil or: [(Smalltalk getSystemAttribute: 1201) asNumber <= 31]]
(Smalltalk getSystemAttribute: 1201 -> '255'
So.....my questions are:
1) Should it answer Unix one, or MacOS? I guess than MacOS, and if it is unix, then we have to solve the kind of problem I have 2) Why (Smalltalk getSystemAttribute: 1201 -> '255' 3) Why not using "Smalltalk platformName" to detect which FileDirectory to use??
Thanks
Mariano
Mariano, Dumb question: what file system is in use? I sometimes get surprised with case insensitivity on Linux when using shared media with Microsoft file systems. From the looks of things, that is probably _not_ your problem, but it's worth ruling out. Bill
H Bill. The file system (as much as I can notice) seems to be Mac OS Extended (Journaled). I am a completly mac newbie...so... Eliot: WOW! I didn't know that you can choose....I am googling now how to change to case sensitive (I hope I don't need to reformat). thanks mariano On Mon, Nov 22, 2010 at 12:55 AM, Schwab,Wilhelm K <bschwab@anest.ufl.edu>wrote:
Mariano,
Dumb question: what file system is in use? I sometimes get surprised with case insensitivity on Linux when using shared media with Microsoft file systems. From the looks of things, that is probably _not_ your problem, but it's worth ruling out.
Bill
participants (3)
-
Eliot Miranda -
Mariano Martinez Peck -
Schwab,Wilhelm K