tim at rowledge.org
Sun Mar 26 20:23:41 UTC 2006
On 25-Mar-06, at 11:11 PM, Andreas Raab wrote:
> tim Rowledge wrote:
>> On 25-Mar-06, at 10:33 PM, Andreas Raab wrote:
>>> This function is news to me - can somebody explain what it's good
>>> for, where it should be used and (most importantly) why we'd
>>> export this for plugins but don't use in the VM itself (e.g., no
>> See mantis 2044 for some details and the original rationale. It
>> also relates somewhat to :-
> I guess you mean http://bugs.impara.de/view.php?id=2404 yes?
Yup. Meant to fix that before hitting send but screwed up, obviously.
> One question about this: Do we have a way of doing that kind of
> file name conversion from the image itself? It strikes me as
> somewhat odd that a plugin needs to do that conversion given that
> the image can just pass a well-formed version of the string as the
> argument, no?
Actually, no. Until and unless we ever get some decent file handling
code in the image we simply can't rely on a passed in filename being
even vaguely decent. My preference is to call a VM routine to
canonicalise the passed in string for every usage simply because you
can rely (for some value of 'rely') on the OS getting it right in
working out that '../../foo/bar/bim.bmp' is actually '/usr/mounts/
It also helps in case where the filenames in the image are not seen
the same way the OS sees them - RISC OS uses unixy paths in Squeak
because the ROS rules are so difficult to fit into the nasty habits
people have of assembling strings as a path and then forcing them
down the primitives. The canonicaliser call gets a chance to swap the
$/ to $. before passing to the OS.
So the idea was to provide an access point to this 'service' within
the core that plugins could use at need. For use in the core itself,
well I guess only image loading/saving is a possible user and that
may or may not be useful. For example in RISC OS you wouldn't need it
for the image name to load since it would already be guaranteed to
have been canonicalised *unless* you were to run from a commandline
and deliberately pass in a dodgy string.
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
When all else fails, let a = 7. If that doesn't help, then read the
More information about the Vm-dev