[squeak-dev] Starting an image from SqueakConsole manipulates pwd
K K Subbu
kksubbu.ml at gmail.com
Sat Jun 13 10:33:17 UTC 2020
On 12/06/20 11:33 pm, K K Subbu wrote:
> On 12/06/20 7:24 pm, Thiede, Christoph wrote:
>> I just rechecked this under Ubuntu. Same issue here. Do you agree
>> that it is a bug that the pwd is changed when starting the VM?
> On all platforms, the default directory is the current directory, but
> FileDirectory>>startUp is setting the default directory to that of the
> image instead of current directory. The attached fix will cure the fault.
> If this works, I will post a patch to Inbox tomorrow.
It won't work :-(. FileDirectory>>startUp calls setDefaultDirectory with
imagePath. When I tried to change this to '.', FileDirectory>>on:
changes it to '/.' :-(.
On unix, pathnames can begin with '.', '..' or '/' with the first one
being the default, if a file does not begin with any one of these
prefixes. These names are late bound.
FileDirectory>>splitName:to: is also broken. It returns an empty string
for '/' (instead of '/') or '/foo' ('.'). A directory name can never be
empty. '/' '.' '..' have to be treated specially. If a path has no
delimiter than the directory is '.'. Also, the basename of '/' is '/'
I tried fixing this method, but the image crashed (couldn't find sources
file). Directory is being checked for empty string in multiple places.
Does anyone have the context around these changes? Haalp!
Regards .. Subbu
More information about the Squeak-dev