File system model (was: UnixFileDirectoryPlugin)

Tim Rowledge tim at sumeru.stanford.edu
Fri Jan 18 18:49:43 UTC 2002


Doug Way <dway at riskmetrics.com> is widely believed to have written:

> 
> Lex Spoon wrote:
> > 
> > ...  At any rate,
> > having half the Squeak community using CrLfFileStream, and the other
> > half not using it, causes some friction: you can decide for yourself to
> > use CrLfFileStream, but if your friends are using it, you can't easily
> > decide *not* to use it.
> 
> One minor point I'd make here is that I wouldn't mind seeing the class CrLfFileStream renamed to something which reveals its intention better, such as HostLineEndFileStream, or NativeLineEndFileStream, or something like that.  Given its name, I used to assume that CrLfFileStream was meant to be used if you wanted CrLf (DOS-style) line endings.  But it really means use the line end convention of the host system.
I think I'd prefer to see the class disappear completely and either
a) make a simple binary/text 'mode' for it
b) make two trivial subclasses (BinaryFileStream/TextFileStream) to
handle the differences

For VMMaker like functionality, I'd like to be able to specify the
lineend form somehow as well, since then I could (with a single mighty
button!) generate source trees for all platforms on any platform. Which
could then be tarballed ready to sit somewhere accessible for those that
want to just compile instead of develop/regenerate.

> 
> > > I'd like to suggest that file names ought to be a class separate from
> > > file streams, for example.
> > 
> > Yes....  that makes sense!
> 
> Yes, I would put this near the top of the to-do list.  Then a bunch of messages which are clumsy in FileDirectory, such as #fileExists:, #deleteFileNamed:, etc., could be simpler messages on a file/filename object such as #exists and #delete.
Exactly my thoughts. Apart from anything else, a file name is quite
different from an actual open file being accessed. And much, much better
to pass around than a String.
There's already some URL stuff around, maybe it would be nice to make
sure it is thoroughly cleaned up and put filenames in that hierarchy.
The old Interval code actually used file urls on all platforms and only
translated them into platform format in the vm; once you got used to the
idea it worked very well. These days I suspect many users are so used to
urls in the browser that they wouldn't even care/notice if they never
saw platform filenames.

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Strange OpCodes: SDL: Shift Disk Left




More information about the Squeak-dev mailing list