Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo
Status: Accepted
Owner: ----
Labels: Milestone-1.4 Type-Bug Milestone-2.0

New issue 5693 by [hidden email]: FileSystem isDirectory behaves  
strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

1.4

'/tmp' asReference isDirectory. false
'/private/tmp' asReference isDirectory. false

'/Users/sven' asReference isDirectory. true
'/Users/sven/Desktop' asReference isDirectory. true

2.0

'/tmp' asFileReference isDirectory. false
'/private/tmp' asFileReference isDirectory. false

'/Users/sven' asFileReference isDirectory. true
'/Users/sven/Desktop' asFileReference isDirectory. true

/tmp is a symlink on Mac OS X
this works on Linux

'/Applications' asFileReference isDirectory. true
'/etc' asFileReference isDirectory. false




_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo

Comment #1 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

For /private/tmp, <primitive: 'primitiveDirectoryLookup'  
module: 'FilePlugin'> returns false for the dir flag... still  
investigating...


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo
Updates:
        Cc: [hidden email]

Comment #2 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

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]
<a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/stringByStandardizingPath">https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/stringByStandardizingPath


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo
Updates:
        Status: Workneeded

Comment #3 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

The patch fixes the '/private/tmp' issue, but not the '/tmp' issue (it not  
follows symlinks)



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo

Comment #4 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

ok, I find a bug and patched... it should be in next vm build


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo

Comment #5 on issue 5693 by marianopeck: FileSystem isDirectory behaves  
strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

Sven, can you check with latest vm and close the issue if fixed?


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo

Comment #6 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

I am not 100% sure what you mean by 'the latest vm', I tried with this VM  
and image:

Image
-----
/Users/sven/Downloads/Pharo-2.0/Pharo-2.0.image
Pharo2.0a
Latest update: #20150
Unnamed

Virtual Machine
---------------
/Users/sven/apps/Smalltalk/Virtual-Machines/CogVM.app/Contents/MacOS/CogVM
CoInterpreter VMMaker-oscog-EstebanLorenzano.160 uuid:  
bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun  1 2012,  
StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.160 uuid:  
bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun  1 2012,  
https://git.gitorious.org/cogvm/blessed.git Commit:  
2b16c2cfc16ef2e08dbc93113ce9552e810e3e78 Date: Wed May 30 16:16:27 2012  
+0200 By: Esteban Lorenzano <[hidden email]>
Mac Cocoa Cog 5.8b12 21-Sep-10 >1B0534FA-246C-47C5-AB29-7A76C81CCDCB<
CoInterpreter VMMaker-oscog-EstebanLorenzano.160 uuid:  
bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun  1 2012
StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.160 uuid:  
bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun  1 2012

And I get

#( '/tmp' '/private/tmp' '/tmp/' '/private/tmp/' '/Users/sven/Desktop' '/Library')
        collect: [ :each |
                each asFileReference isDirectory ]

#(false false false false true true)

Maybe I tested with the wrong VM ?



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo

Comment #7 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

I get  #(false false false false false true)

  'CoInterpreter VMMaker-oscog-EstebanLorenzano.160 uuid:  
bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun  1 2012,  
StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.160 uuid:  
bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun  1 2012,  
https://git.gitorious.org/cogvm/blessed.git Commit:  
2b16c2cfc16ef2e08dbc93113ce9552e810e3e78 Date: Wed May 30 16:16:27 2012  
+0200 By: Esteban Lorenzano <[hidden email]>'


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo

Comment #8 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

so essentially we fail resolving aliases?


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo

Comment #9 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

I'm getting

#(false true false true true true)

which is better, but still wrong. I will check what is still happening


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo

Comment #10 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

ok esteban fixed this apparently years ago (a couple of weeks) but our  
build server did not do it.

CoInterpreter VMMaker-oscog-EstebanLorenzano.160 uuid:  
bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun 22 2012,
StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.160 uuid:  
bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun 22 2012
https://git.gitorious.org/cogvm/blessed.git Commit:  
744bfe905c78a1a5d408680a8780367ea77e0549 Date: Fri Jun 1 15:17:41 2012  
+0200 By: Esteban Lorenzano <[hidden email]>'


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo

Comment #11 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

so... we can confirm that is working? (I want to close this)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo

Comment #12 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

Yes, on a recent 2.0 and CogVM is works now:

#( '/tmp' '/private/tmp' '/tmp/' '/private/tmp/' '/Users/sven/Desktop' '/Library')
        collect: [ :each |
                each asFileReference isDirectory ]

#(true true true true true true)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5693 in pharo: FileSystem isDirectory behaves strange on Mac OS X

pharo
Updates:
        Status: Closed

Comment #13 on issue 5693 by [hidden email]: FileSystem isDirectory  
behaves strange on Mac OS X
http://code.google.com/p/pharo/issues/detail?id=5693

closing then :)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker