[ANN] [UPDATES] Squeak 3.4 now in beta

Ned Konz ned at bike-nomad.com
Wed Dec 4 06:20:25 UTC 2002


On Tuesday 03 December 2002 05:10 pm, Richard A. O'Keefe wrote:
> Scott Wallace <scott.wallace at squeakland.org>
> announced updates to Squeak 3.4.
> One of them puzzles me mightily:
> 	5131macRelativeFNFix-nk -- Ned Konz -- 23 November 2002
> 	The SARInstaller didn't work on the Connectors package because it
> 	wasn't able to make the required subdirectories.
> 	This change set fixes the handling of relative and absolute
> filenames under MacOS, and uses these conventions:
> 	* fileName starts with :: -> absolute
> 	* fileName starts with : -> relative
> 	* fileName starts with the name of a folder under the root ->
> absolute * otherwise -> relative
> 	It also fixes ArchiveViewer to use the previously-fixed extraction
> 	code in ZipArchiveMember.
>
> In MacOS, ::foo does not signify an absolute path,
> but a path relative to the parent directory.

Ah, this is good to know. So it's like "../foo"?

> No other Macintosh programming language I've used
> interprets multiple leading colons in a file name as absolute.
>
> Why was this convention chosen?

Because I don't know anything about the Mac and I was going by a 
suggestion on the list when I asked (back on 12 Nov?):

From Raymond Asselin:
Hi Ned,  I¹m far from an expert and may be what I will tell you is to 
be trash but with old mac
it was necessary that the first level (root is the name I think ?) be 
::xxx:yyy:zzz, a double colon...

I heard nothing on the 23rd of November when I posted the proposed fix 
to the list.

However, I could change it easily. I'm certainly not depending on it. 
I'm just trying to get relative pathnames to work predictably when 
extracting archives.

What should the equivalent be for the following Unix path conventions:

/aVolume/anAbsolute/path
	is this "aVolume:anAbsolute:path" ?
aRelativePath/somewhere (a/k/a ./aRelativePath/somewhere)
	is this ":aRelativePath/somewhere"?
../some/path/relative/to/the/parent
	is this "::some:path:relative:to:the:parent"?
../../some/other relative path
	is this ":::some:other relative path"?

or the following Win32 path conventions:

c:\absolute\path
\relative\to\current\volume
relative\to\current\directory\on\current\volume

Do you agree that paths starting with a single colon are relative (to 
something, presumably the default directory in Squeak)? This seems to 
also be what MacPerl does (see File::Spec::Mac Perl module docs).

So how do I test whether a path is relative or absolute? Obviously I 
can check against subdirectories (presumably volumes) under the root, 
but will this work in all cases? 

The description for isAbsolute() in Perl's File::Spec::Mac is:
---
Takes as argument a path and returns true, if it is an absolute path. 
If the path has a leading ":", it's a relative path. Otherwise, it's 
an absolute path, unless the path doesn't contain any colons, i.e. 
it's a name like "a". In this particular case, the path is considered 
to be relative (i.e. it is considered to be a filename). Use ":" in 
the appropriate place in the path if you want to distinguish 
unambiguously. As a special case, the filename '' is always 
considered to be absolute. Note that with version 1.2 of 
File::Spec::Mac, this does no longer consult the local filesystem. 
---

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




More information about the Squeak-dev mailing list