[Top][All Lists]

[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 (
SystemExceptions.FileError class(Exception class)>>signal: (
File class>>checkError: (
File class>>checkError (
File>>namesDo: (
File(FilePath)>>do: (
File(FilePath)>>select: (
File(FilePath)>>directories (
UndefinedObject>>executeStatements (a String:1)

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]