DosFileDirectory>>fullPathFor: bug?

Ned Konz ned at bike-nomad.com
Mon May 15 21:49:09 UTC 2000


Hi everyone,

I've just joined the list after having gotten inspired to use
Squeak on my NEC MobilePro 770 (a Windows/CE handheld).

But I'm having problems starting the image: it asks for a changes file,
and every reply I give it gets translated into a strange filename,
which it can't find.

DosFileDirectory default fullPathFor: '\CF\Squeak\tiny.changes'

answers '\C\CF\Squeak\tiny.changes'
when it should answer '\CF\Squeak\tiny.changes' for some reason.

This is the code (with my comments) (sorry I stripped the source):

fullPathFor: t1 
	t1 isEmpty ifTrue: [^ pathName].	"ok"
	(t1 at: 1)
		= $\
		ifTrue: 
			[(t1 size >= 2 and: [(t1 at: 2)
					= $\])
				ifTrue: [^ t1].	"ok, handles UNC paths"
			^ (pathName copyFrom: 1 to: 2)
				, t1].	"This is where the problem is!"
	(t1 size >= 2
		and: [(t1 at: 2)
				= $: and: [t1 first isLetter]])
		ifTrue: [^ t1].	"ok, a DOS-style path with drive letter"
	^ pathName , self slash , t1! !		"ok, relative to me"


So I can't understand why the code is (intentionally) munging my path.

I should note that in Windows/CE there are no drive letters. So absolute
paths start with a backslash and a name.

I can't figure out why the first two characters are being copied in the
above code.

Is this a bug or something I'm missing?

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com, Perl homepage:
http://bike-nomad.com/perl





More information about the Squeak-dev mailing list