Back: DirectedMessage-saving and loading Up: Base classes Forward: Directory class-file name management   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.63 Directory

Defined in namespace Smalltalk
Superclass: File
Category: Streams-Files
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).

1.63.1 Directory class: file name management  (class)
1.63.2 Directory class: file operations  (class)
1.63.3 Directory class: reading system defaults  (class)
1.63.4 Directory: accessing  (instance)
1.63.5 Directory: enumerating  (instance)


1.63.1 Directory class: file name management

append: fileName to: directory
Answer the name of a file named `fileName' which resides in a directory named `directory'.

pathSeparator
Answer (as a Character) the character used to separate directory names

pathSeparatorString
Answer (in a String) the character used to separate directory names


1.63.2 Directory class: file operations

allFilesMatching: aPattern do: aBlock
Invoke #allFilesMatching:do: on the current working directory.

create: dirName
Create a directory named dirName and answer it.

createTemporary: prefix
Create an empty directory whose name starts with prefix and answer it.

working
Answer the current working directory, not following symlinks.

working: dirName
Change the current working directory to dirName.


1.63.3 Directory class: reading system defaults

home
Answer the path to the user's home directory

image
Answer the path to GNU Smalltalk's image file

kernel
Answer the path in which a local version of the GNU Smalltalk kernel's Smalltalk source files were searched when the image was created

libexec
Answer the path to GNU Smalltalk's auxiliary executables

localKernel
Answer the path to the GNU Smalltalk kernel's Smalltalk source files. Same as `Directory kernel' since GNU Smalltalk 2.4.

module
Answer the path to GNU Smalltalk's dynamically loaded modules

systemKernel
Answer the path to the GNU Smalltalk kernel's Smalltalk source files. Same as `Directory kernel' since GNU Smalltalk 2.4.

temporary
Answer the path in which temporary files can be created. This is read from the environment, and guessed if that fails.

userBase
Answer the base path under which file for user customization of GNU Smalltalk are stored.


1.63.4 Directory: accessing

at: aName
Answer a File or Directory object as appropriate for a file named 'aName' in the directory represented by the receiver.

directoryAt: aName
Answer a Directory object for a file named `aName' residing in the directory represented by the receiver.

fileAt: aName
Answer a File object for a file named `aName' residing in the directory represented by the receiver.

fullNameAt: aName
Answer a String containing the full path to a file named `aName' which resides in the directory represented by the receiver.

includes: aName
Answer whether a file named `aName' exists in the directory represented by the receiver.

nameAt: aName
Answer a String containing the path to a file named `aName' which resides in the directory represented by the receiver.

pathTo: destName
Compute the relative path from the receiver to destName.


1.63.5 Directory: enumerating

allFilesMatching: aPattern do: aBlock
Evaluate aBlock on the File objects that match aPattern (according to String>>#match:) in the directory named by the receiver. Recursively descend into directories.

contents
Answer an Array with the names of the files in the directory represented by the receiver.

do: aBlock
Evaluate aBlock once for each file in the directory represented by the receiver, passing its name. aBlock should not return.

filesMatching: aPattern do: block
Evaluate block on the File objects that match aPattern (according to String>>#match:) in the directory named by the receiver.

namesMatching: aPattern do: block
Evaluate block on the file names that match aPattern (according to String>>#match:) in the directory named by the receiver.



Back: Directory-accessing Up: Directory Forward: DLD   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on May, 22 2008 using texi2html