Back: False-printing
Up: Class reference
Forward: File class-C functions
 
Top: GNU Smalltalk User's Guide
Contents: Table of Contents
Index: Class index
About: About this document

6.66 File

Defined in namespace Smalltalk
Category: Streams-Files

6.66.1 File class: C functions  (class)
6.66.2 File class: file name management  (class)
6.66.3 File class: file operations  (class)
6.66.4 File class: initialization  (class)
6.66.5 File class: instance creation  (class)
6.66.6 File class: reading system defaults  (class)
6.66.7 File class: testing  (class)
6.66.8 File: accessing  (instance)
6.66.9 File: C functions  (instance)
6.66.10 File: file name management  (instance)
6.66.11 File: file operations  (instance)
6.66.12 File: testing  (instance)


6.66.1 File class: C functions

errno
C call-out to errno. Do not modify!

primRemove: fileName
C call-out to unlink. Do not modify!

primRename: oldFileName to: newFileName
C call-out to rename. Do not modify!

stringError: errno
C call-out to strerror. Do not modify!


6.66.2 File class: file name management

extensionFor: aString
Answer the extension of a file named `aString'

fullNameFor: aString
Answer the full path to a file called `aString', resolving the `.' and `..' directory entries, and answer the result. Answer nil if the file is invalid (such as '/usr/../..')

pathFor: aString
Answer the path of the name of a file called `aString', and answer the result

stripExtensionFrom: aString
Remove the extension from the name of a file called `aString', and answer the result

stripPathFrom: aString
Remove the path from the name of a file called `aString', and answer the file name plus extension.


6.66.3 File class: file operations

checkError
Return whether an error had been reported or not. If there had been one, raise an exception too

checkError: errno
The error with the C code `errno' has been reported. If errno >= 1, raise an exception

remove: fileName
Remove the file with the given path name

rename: oldFileName to: newFileName
Rename the file with the given path name oldFileName to newFileName


6.66.4 File class: initialization

initialize
Initialize the receiver's class variables


6.66.5 File class: instance creation

name: aName
Answer a new file with the given path. The path is not validated until some of the fields of the newly created objects are accessed


6.66.6 File class: reading system defaults

image
Answer the full path to the image being used.


6.66.7 File class: testing

exists: fileName
Answer whether a file with the given name exists

isAccessible: fileName
Answer whether a directory with the given name exists and can be accessed

isExecutable: fileName
Answer whether a file with the given name exists and can be executed

isReadable: fileName
Answer whether a file with the given name exists and is readable

isWriteable: fileName
Answer whether a file with the given name exists and is writeable


6.66.8 File: accessing

creationTime
Answer the creation time of the file identified by the receiver. On some operating systems, this could actually be the last change time (the `last change time' has to do with permissions, ownership and the like).

lastAccessTime
Answer the last access time of the file identified by the receiver

lastChangeTime
Answer the last change time of the file identified by the receiver (the `last change time' has to do with permissions, ownership and the like). On some operating systems, this could actually be the file creation time.

lastModifyTime
Answer the last modify time of the file identified by the receiver (the `last modify time' has to do with the actual file contents).

name
Answer the name of the file identified by the receiver

refresh
Refresh the statistics for the receiver

size
Answer the size of the file identified by the receiver


6.66.9 File: C functions

closeDir: dirObject
C call-out to closedir. Do not modify!

openDir: dirName
C call-out to opendir. Do not modify!

primIsExecutable: name
C call-out to fileIsExecutable. Do not modify!

primIsReadable: name
C call-out to fileIsReadable. Do not modify!

primIsWriteable: name
C call-out to fileIsWriteable. Do not modify!

statOn: fileName into: statStruct
C call-out to stat. Do not modify!


6.66.10 File: file name management

extension
Answer the extension of the receiver

fullName
Answer the full name of the receiver, resolving the `.' and `..' directory entries, and answer the result. Answer nil if the name is invalid (such as '/usr/../../badname')

path
Answer the path (if any) of the receiver

stripExtension
Answer the path (if any) and file name of the receiver

stripPath
Answer the file name and extension (if any) of the receiver


6.66.11 File: file operations

contents
Open a read-only FileStream on the receiver, read its contents, close the stream and answer the contents

open: mode
Open the receiver in the given mode (as answered by FileStream's class constant methods)

readStream
Open a read-only FileStream on the receiver

remove
Remove the file identified by the receiver

renameTo: newName
Remove the file identified by the receiver

writeStream
Open a write-only FileStream on the receiver


6.66.12 File: testing

exists
Answer whether a file with the name contained in the receiver does exist.

isAccessible
Answer whether a directory with the name contained in the receiver does exist and can be accessed

isDirectory
Answer whether a file with the name contained in the receiver does exist and identifies a directory.

isExecutable
Answer whether a file with the name contained in the receiver does exist and is executable

isFile
Answer whether a file with the name contained in the receiver does exist and does not identify a directory.

isReadable
Answer whether a file with the name contained in the receiver does exist and is readable

isWriteable
Answer whether a file with the name contained in the receiver does exist and is writeable




This document was generated on May, 12 2002 using texi2html