InterpreterProxy>>ioFilename:fromString:ofLength:resolveAliases:?
John M McIntosh
johnmci at smalltalkconsulting.com
Sun Mar 26 23:49:53 UTC 2006
I believe fname here and length is technically the smalltalk object,
and it's length. If you copy over from the fname it may not have
a terminating 0x00.
buf[length] = 0x00
Also if you run the image as UTF-8 would copying the file name
directly and assume you've get a file name that is usable by Windows,
is that correct?
On 26-Mar-06, at 3:17 PM, Andreas Raab wrote:
> tim Rowledge wrote:
>>> 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/someOtherComputer/viaALink/mumble/frotz.jpeg'.
>
> All right, you guys know this better than I do (since I don't have
> this problem ;-) So, just for verification, the following is a
> legal implementation for the method, yes?
>
> int sqGetFilenameFromString(char *buf, char *fname, int length, int
> b) {
> memcpy(buf, fname, length);
> return 1;
> }
>
>> 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 manual.
>
> How fitting ;-) It was just how I felt when writing the above. Are
> you sure this is random?
>
> Cheers,
> - Andreas
--
========================================================================
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
========================================================================
===
More information about the Vm-dev
mailing list