[Pharo-project] Confused about #isDirectory
Hi, I don't understand why '/tmp' asReference isDirectory. false '/private/tmp' asReference isDirectory. false '/Users/sven' asReference isDirectory. true '/Users/sven/Desktop' asReference isDirectory. true on Pharo 1.4 Mac OS X Cog VM. Anybody any idea ? Am I doing something wrong ? Thx, Sven
On Thu, Apr 26, 2012 at 12:47 PM, Sven Van Caekenberghe <sven@beta9.be> wrote:
'/tmp' asReference isDirectory. false '/private/tmp' asReference isDirectory. false
'/Users/sven' asReference isDirectory. true '/Users/sven/Desktop' asReference isDirectory. true
on Pharo 1.4 Mac OS X Cog VM.
For what it's worth, working as expected on Linux (using either deprecated asReference or asFileReference) : /tmp true /home/alexisp true /nosuchpath false Pharo 1.4-14438 'CoInterpreter VMMaker-oscog-EstebanLorenzano.139 uuid: 5aa53979-d7d8-4ca3-91fe-cfc3b4109c33 Jan 26 2012, StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.139 uuid: 5aa53979-d7d8-4ca3-91fe-cfc3b4109c33 Jan 26 2012, https://git.gitorious.org/cogvm/blessed.git Commit: e49a136ea9fe909dd5ba3cdeffac8f61cce27c9f Date: Thu Jan 26 17:38:06 2012 +0100 By: Camillo Bruni <camillobruni@gmail.com>'
Hi Alexis, On 26 Apr 2012, at 13:49, Alexis Parseghian wrote:
On Thu, Apr 26, 2012 at 12:47 PM, Sven Van Caekenberghe <sven@beta9.be> wrote:
'/tmp' asReference isDirectory. false '/private/tmp' asReference isDirectory. false
'/Users/sven' asReference isDirectory. true '/Users/sven/Desktop' asReference isDirectory. true
on Pharo 1.4 Mac OS X Cog VM.
For what it's worth, working as expected on Linux (using either deprecated asReference or asFileReference) :
/tmp true /home/alexisp true /nosuchpath false
Pharo 1.4-14438 'CoInterpreter VMMaker-oscog-EstebanLorenzano.139 uuid: 5aa53979-d7d8-4ca3-91fe-cfc3b4109c33 Jan 26 2012, StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.139 uuid: 5aa53979-d7d8-4ca3-91fe-cfc3b4109c33 Jan 26 2012, https://git.gitorious.org/cogvm/blessed.git Commit: e49a136ea9fe909dd5ba3cdeffac8f61cce27c9f Date: Thu Jan 26 17:38:06 2012 +0100 By: Camillo Bruni <camillobruni@gmail.com>'
I was afraid of that ;-) I don't have #asFileReference in my Pharo 1.4 image and #asReference is not deprecated, is that new ? Sven
we changed that not so long ago :) but it will do the same.... the problem will be that the VM primitive might not follow symlinks (that would explain the first line) no clue though why it should return false for '/private/var'... On 2012-04-26, at 13:58, Sven Van Caekenberghe wrote:
Hi Alexis,
On 26 Apr 2012, at 13:49, Alexis Parseghian wrote:
On Thu, Apr 26, 2012 at 12:47 PM, Sven Van Caekenberghe <sven@beta9.be> wrote:
'/tmp' asReference isDirectory. false '/private/tmp' asReference isDirectory. false
'/Users/sven' asReference isDirectory. true '/Users/sven/Desktop' asReference isDirectory. true
on Pharo 1.4 Mac OS X Cog VM.
For what it's worth, working as expected on Linux (using either deprecated asReference or asFileReference) :
/tmp true /home/alexisp true /nosuchpath false
Pharo 1.4-14438 'CoInterpreter VMMaker-oscog-EstebanLorenzano.139 uuid: 5aa53979-d7d8-4ca3-91fe-cfc3b4109c33 Jan 26 2012, StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.139 uuid: 5aa53979-d7d8-4ca3-91fe-cfc3b4109c33 Jan 26 2012, https://git.gitorious.org/cogvm/blessed.git Commit: e49a136ea9fe909dd5ba3cdeffac8f61cce27c9f Date: Thu Jan 26 17:38:06 2012 +0100 By: Camillo Bruni <camillobruni@gmail.com>'
I was afraid of that ;-)
I don't have #asFileReference in my Pharo 1.4 image and #asReference is not deprecated, is that new ?
Sven
On 26 Apr 2012, at 15:11, Camillo Bruni wrote:
we changed that not so long ago :) but it will do the same.... the problem will be that the VM primitive might not follow symlinks (that would explain the first line)
no clue though why it should return false for '/private/var'...
OK: http://code.google.com/p/pharo/issues/detail?id=5693 Sven
Camillo Bruni-3 wrote
no clue though why it should return false for '/private/var'...
For /private/var, <primitive: 'primitiveDirectoryLookup' module: 'FilePlugin'> returns false for the dir flag... still investigating... -- View this message in context: http://forum.world.st/Confused-about-isDirectory-tp4589441p4590063.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Sean P. DeNigris wrote
For /private/var, <primitive: 'primitiveDirectoryLookup' module: 'FilePlugin'> returns false for the dir flag... still investigating...
sqSqueakOSXFileDirectoryInterface-resolvedAliasFiles: calls stringByStandardizingPath on the filePath, which the manual [1] states may "Remove an initial component of â/privateâ from the path if the result still indicates an existing file or directory (checked by consulting the file system).". This returns /var for /private/var, which is a symlink. Removing the call returns the correct value (true) for "". Also, all Tests-Files and Filesystem-Tests pass in 1.4. The changed snippet is (I also fixed the misspelled variable "compoents" to "components"): - (NSString *)resolvedAliasFiles:(NSString *)filePath { NSArray *components = [filePath pathComponents]; // removed stringByStandardizingPath call NSString *thisComponent; NSString *path = [[NSString new] autorelease]; for (thisComponent in components) { [1] https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Found... -- View this message in context: http://forum.world.st/Confused-about-isDirectory-tp4589441p4590343.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Should have been... Sean P. DeNigris wrote
Removing the call returns the correct value (true) for "'/private/tmp' asFileReference isDirectory"
-- View this message in context: http://forum.world.st/Confused-about-isDirectory-tp4589441p4590346.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Sean P. DeNigris wrote
The changed snippet is...
Issue 79: primitiveDirectoryLookup returns wrong dir flag http://code.google.com/p/cog/issues/detail?id=79 -- View this message in context: http://forum.world.st/Confused-about-isDirectory-tp4589441p4590357.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
participants (4)
-
Alexis Parseghian -
Camillo Bruni -
Sean P. DeNigris -
Sven Van Caekenberghe