[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Paths in breaking when moved

From: Brett Cundal
Subject: Re: [Help-smalltalk] Paths in breaking when moved
Date: Thu, 11 Apr 2002 09:22:53 -0700
User-agent: Mutt/1.3.28i

On Thu, Apr 11, 2002 at 11:37:48AM +0200, Bonzini Paolo wrote:
> I (or you) can write a #relocateFrom:to: method for the FileSegment class
> and then, as part of installing, I (or you) can do
> [snip]
> I do not remember though if the startsWith: method exists in String. :-)

Apparently not... although it looks like it would be trivial:
(Seems to belong in CharacterArray...?)

startsWith: aCharacterAray
    ^(aCharacterArray, '*') match: self

...That might be a kludgey implementation, since it has all the extra
behavior of match:... Anyhow... It works well enough to be used in
relocateFrom:to:... If you can locate a better startsWith
implementation it would probably be better to use that.

> I can put together a patch in the weekend and release new
> stable/development versions with it.  Or if you can do it, please go on
> and mail the diff here.  It is only little more than juggling.

I took a crack at it... here's the goods:

setFileName: aFileName 
"There didn't seem to be an accessor for this - setFile does other stuff"
    file := aFileName. 

relocateFrom: fromPath to: toPath
    ((fromPath, '*') match: self getFile) ifTrue: [  
        self setFileName: toPath,  
            (self getFile copyFrom: (fromPath size) + 1 to: self getFile size) 

It rewrites the filenames in the I haven't tested whether
this fixes my particular problem yet. If I work it all out before you
issue a new version I'll let you know.

-- Brett

Attachment: pgp7OI0UcInev.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]