FilePath on macOS

68 views
Skip to first unread message

Andrew

unread,
Jun 11, 2017, 10:22:50 AM6/11/17
to Newspeak Programming Language
Apologies, another newbie question I'm afraid!  I am trying to construct a FilePath using Newspeak on macOS.  

Evaluating the below in a workspace results in an error:

((platform files FilePath) for: '/Users/')

The issue seems to be in class FilePath:

public for: nm <String>  ^ <FilePath> = (
^platformSpecificPathClass new pattern: nm
)

Evaluating 'platformSpecificPathClass' in this frame results in 'nil', as does evaluating the below in the workspace:

platform files platformSpecificPathClass

I see these two slots in the definition of Files:

public platformSpecificPathClass
public platformSpecificPatternClass

which get set in RuntimeForSqueak>>Platform resetForNewImageSession:

...
squeak OSProcess isUnixMac ifTrue:
[macfiles resetForNewImageSession.
files platformSpecificPathClass: macfiles MacOSXFilePath.
files platformSpecificPatternClass: macfiles MacOSXFilePattern].
...

Perhaps I need to do a reset of some sort (I have tried the bottom 3 options under the 'Tools' menu but this doesn't seem to have made any difference)?

Any assistance would be much appreciated.  

Thanks very much!

Gilad Bracha

unread,
Jun 11, 2017, 6:16:41 PM6/11/17
to Newspeak Programming Language
Hi Andrew,

It all works fine for me on a mac. What platform are you running on? What boot image and what VM? 


Gilad Bracha

unread,
Jun 11, 2017, 6:23:25 PM6/11/17
to Newspeak Programming Language
To clarify: by platform, I mean what version of macOS (not that it should matter). 

Andrew

unread,
Jun 12, 2017, 3:05:10 PM6/12/17
to Newspeak Programming Language
Hi Gilad

I've just tried this with the latest image and VM (ns-2017-05-31.64 / cog_macos64x64_newspeak.cog.spur_201703272314) running on Mac OS Sierra 10.12.5.

When first launching the image I did notice the attached error however.

Cheers

Andrew
Screen Shot 2017-06-12 at 19.53.29.png

Gilad Bracha

unread,
Jun 12, 2017, 3:33:35 PM6/12/17
to Newspeak Programming Language
Interesting. The 64 bit version has this problem, whereas the 32 bit one does not. I always use the 32 bit, because the 64 bit was an evolving thing, and never as solid as I'd like. For immediate relief, try the 32 bit image and VM. We'll try and get to the bottom of the 64 bit problem.

The error you're showing complains that the sources file is missing. I assume the path shown is the path to the VM you are running? However, the VM application has the sources file packaged within it so this should not occur. Perhaps the 64 bit VM has an issue with files in general; it may be more of another symptom of the problem than a cause.

Gilad Bracha

unread,
Jun 12, 2017, 3:58:41 PM6/12/17
to Newspeak Programming Language
Tracking this down, one finds that Alien class>>libcName doesn't even try to work for 64 bit on mac.  

Andrew

unread,
Jun 12, 2017, 4:35:34 PM6/12/17
to Newspeak Programming Language
Thanks for the thorough investigation and for the suggestion.  Good news: I can confirm that code works as expected on the latest 32-bit VM and image on my Mac. 

Yes that's right, the path is my VM's.  I also see the error when running in 32-bit but it doesn't appear to affect the usability of the image.

Out of interest, I tried the 32-bit set-up on Windows 10: no sources error appeared and a Win32FilePath was successfully returned.

I've read about Aliens but haven't delved into them yet -- this sounds like a good opportunity to do some digging.

Thanks again!

Gilad Bracha

unread,
Jun 12, 2017, 4:46:12 PM6/12/17
to Newspeak Programming Language
You're welcome. We should have fixes for the 64 bit version soon as well. Thanks for exercising this.

Andrew

unread,
Jun 12, 2017, 5:15:57 PM6/12/17
to Newspeak Programming Language
No problem, sounds good.

Gilad Bracha

unread,
Jun 14, 2017, 8:26:38 PM6/14/17
to Newspeak Programming Language
There are now updated images on the web site (dated 2017-0614) which should correct this problem for 64 bit files.


On Sunday, June 11, 2017 at 7:22:50 AM UTC-7, Andrew wrote:

Andrew

unread,
Jun 16, 2017, 12:12:45 PM6/16/17
to Newspeak Programming Language
That is great, thank you =)
Reply all
Reply to author
Forward
0 new messages