[Cuis-dev] fix for leading tilda in DirectoryEntry, or am I going about this the wrong way?

Imran Rafique imran at rafique.org
Mon Jul 24 06:08:56 PDT 2023


Hello list,

I'm hesitant to call this a bugfix, as its quite possible (probable?)
that I'm going about this the wrong way (or I've grasped the wrong end
of the stick), but here goes:

Original behaviour:
    '~/foo' asDirectoryEntry  =>  <image_dir>/foo

Should be:
    <user_home_dir>/foo

I think I understand the real issue: without OSProcess, there's no way
for the system to know what $HOME is. Perhaps <image_dir> is
considered as a reasonable fallback (in which case, disregard the rest
of this).

Details:
- the attached changeset is a manually-extracted portion of one of my
local packages (with just the code pertaining to this issue)
- it modifies FileIOAccessor >> absolutePathComponentsFor:  so that it
behaves differently and correctly interprets '~' ONLY if OSProcess is
loaded.
- which means that DirectoryEntry would give different answers for the
same '~/whatever' depending on the state of the image. This is
probably bad practice on my part, but anyway, it was annoying me.


If this is a bogus fix, please excuse the noise to the list. Either
way, the learning experience is a blast (just starting to get the hang
of the debugger).

--
Regards,
       Imran Sher Rafique
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-for-leading-tilda-in-DirectoryEntry.st
Type: application/octet-stream
Size: 1655 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230724/9b9c7a2d/attachment-0001.obj>


More information about the Cuis-dev mailing list