[BUG?] UnixFileDirectory

David Pennell dpennell at quallaby.com
Wed Mar 22 01:15:13 UTC 2000


Lex,

Yes, your alternative works fine.  My image even has the method, last
touched by jm on 12/5/97.

I'm a little slow, but I finally hear you saying that FileDirectory and
its children are only supposed to work with fully qualified paths.  This
would certainly explain some of the comments.  I just assumed that relative
paths would work since this is so common in most other environments.
It did work on Windows, but not on Unix.

IF we want to restrict FileDirectories to full path names, then I would
suggest that we enforce this.  The instance creation methods, #forFileName:
and #on:, currently do not. At the moment, DosFileDirectory seems quite
happy to deal with relative directories and UnixFileDirectory gratuitously
changes an unqualified path into a qualified path.  I can't speak for the
behavior on Mac's.

-david

> > FileDirectory forFileName: 'foo',FileDirectory slash,'bar.txt', you get
> > 'foo'
> >
> > If you run the same command on Unix, you get '/foo'.
> >
>
> A alternative way to do this is:
>
> 	| directory file |
> 	directory := FileDirectory default directoryNamed: 'foo'.
> 	file := directory readOnlyFileNamed: 'bar.txt'
>
>
> The only thing is, I just realized that there is no #directoryNamed: in
> the current image.  Hmmm, this seems to work:
>
>
> 	directoryNamed: directoryName
> 		"open the directory given by directoryName, with
> directoryName
> interpreted relative to the receiver"
> 		^FileDirectory on: (self fullNameFor: directoryName)
>
>
>
> Lex
>





More information about the Squeak-dev mailing list