help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Directory/File/FilePath


From: Sean Allen
Subject: [Help-smalltalk] Directory/File/FilePath
Date: Thu, 8 Jan 2009 21:36:39 -0500

Ok, I'm rather confused. Are the Directory, File and FilePath classes in a state of flux?

I assumed that Directory would subclass FilePath but it doesn't. There aren't even any instance methods
but the class comment is:

I am the counterpart of File in a tree-structured file system: I can
iterate through the file that I contain and construct new instances
of File and Directory.  In addition I have the notion of a current
working directory (which alas must be a real directory and not a
virtual one).

So it would seem that its in a state of flux... Is Directory set to become a subclass of FilePath? Would all of the FilePath enumerating methods move to Directory so the following isnt possible?

st> file := File name: '/Users/Spooneybarger/ed.txt'
<File /Users/Spooneybarger/ed.txt>
st> file directories
Object: File error: Not a directory
SystemExceptions.FileError(Exception)>>signal (AnsiExcept.st:216)
SystemExceptions.FileError class(Exception class)>>signal: (AnsiExcept.st:79)
File class>>checkError: (File.st:85)
File class>>checkError (File.st:74)
File>>namesDo: (File.st:588)
File(FilePath)>>do: (FilePath.st:811)
File(FilePath)>>select: (FilePath.st:859)
File(FilePath)>>directories (FilePath.st:781)
UndefinedObject>>executeStatements (a String:1)
nil
st>

Or are we supposed use in this fashion?

file := File name: '/Users/Spooneybarger'
file isDirectory ifTrue: [ file directories ]






reply via email to

[Prev in Thread] Current Thread [Next in Thread]