Old Mac OS and relative pathnames?

Ned Konz ned at bike-nomad.com
Wed Nov 13 06:37:59 UTC 2002


On Tuesday 12 November 2002 09:30 pm, Masato Sumi wrote:

> When xxx is one of the volume names, 'xxx:yyy' should be recognized
> as full path name.  But not, that should be ...  Ok, I wrote down
> my opinion as Smalltalk code that be attached.

Thank you.

Now this works better:

d := FileDirectory default.
fullName := d fullPathFor: ':xxx:yyy:zzz'.
fullDir := FileDirectory forFileName: fullName.
fullDir assureExistence.

but this still does not work:

(FileDirectory on: ':xxx:yyy:zzz') assureExistence.

So I changed FileDirectory>>on: to read like this:

----
on: pathString
	"Return a new file directory for the given path, of the appropriate 
FileDirectory subclass for the current OS platform."

	| pathName |
	DirectoryClass ifNil: [DirectoryClass _ self activeDirectoryClass].
	"If path ends with a delimiter (: or /) then remove it"
	((pathName _ pathString) endsWith: self pathNameDelimiter asString) 
ifTrue: [
		pathName _ pathName copyFrom: 1 to: pathName size - 1].
	^ DirectoryClass new setPathName: (self default fullNameFor: 
pathName)
----

However, when I tried the example again:

(FileDirectory on: ':xxx:yyy:zzz') assureExistence.

Squeak died with "an error of type 2". I assume that means that 
there's a problem somewhere; the Mac won't tell me what "an error of 
type 2" actually is.

What's going on here?

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list