File tom/File


class tom.File

The File class offers an abstraction from files in the filesystem.

Inherits

State supers
ByteStream, SeekableStream, Constants, Conditions

variables

const OPEN_INPUT = 256
const OPEN_OUTPUT = 512

methods

String
  directory-of-file String name;
Return the directory-name of the directory containing the file named filename.

String
  expand-filename String filename
     relative-to: String directory = nil;
Expand the filename relative to the directory. If directory is nil, expansion is relative to the current working directory.

String
  express-filename String filename
       relative-to String directory;
Express the filename in terms relative to the directory.

String
  filename-as-directory String filename;
Return the filename as the name of a directory.

MutableArray
  filenames-in-directory String dir_name;
Return the filenames in the directory named dir_name.

String
  locate-file String file
   along-path Indexed path;
Return the filename of the file somewhere along the path. Return nil if it could not be found.

boolean
  file-exists String name;
Return YES iff the file name exists.

instance (id)
     open String name
   input: boolean input_p = FALSE
  output: boolean output_p = FALSE
   flags: int action = 0;
Return a new File.

instance (id)
        open String name
   alongPath Indexed path
     subdir: String subdir1 = nil
  subsubdir: String subdir2 = nil;
Search for the file along the path. The last element in the path is tried first.

For the subdirectories subdir1 and subdir2, when not nil, the following attempts are made for a dir in the path: dir, dir/subdir2, dir/subdir1, and dir/subdir1/subdir2.

void
  remove String name;
Remove the file or directory with the name.

instance tom.File

variables

public String name;
The name of the file.
int flags;
If it is to be reopenend, these are the flags indicating how to do so.

methods

protected id
   init String n
  flags int f;
Designated initializer.

String
  directoryName;
Return the name of the directory containing our file.

id
  reopen;
Reopen the file according to the flags.

OutputStream
  writeFields OutputStream s;
Undocumented.

Positioning

long
  length;
Return the length of the file.

long
  position;
Return the current file position.

void
       seek long offset
  relative: int whence = STREAM_SEEK_SET;
Position the file `pointer'.


Generated by tm 1.0.