Back: False-printing Up: Base classes Forward: File class-C functions   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.73 File

Defined in namespace Smalltalk
Superclass: FilePath
Category: Streams-Files
I enable access to the properties of files that are on disk.

1.73.1 File class: C functions  (class)
1.73.2 File class: file operations  (class)
1.73.3 File class: initialization  (class)
1.73.4 File class: instance creation  (class)
1.73.5 File class: reading system defaults  (class)
1.73.6 File class: testing  (class)
1.73.7 File: accessing  (instance)
1.73.8 File: basic  (instance)
1.73.9 File: directory operations  (instance)
1.73.10 File: file name management  (instance)
1.73.11 File: file operations  (instance)
1.73.12 File: still unclassified  (instance)
1.73.13 File: testing  (instance)


1.73.1 File class: C functions

errno
Answer the current value of C errno.

stringError: errno
Answer C strerror's result for errno.


1.73.2 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

symlink: srcName as: destName
Create a symlink for the srcName file with the given path name

symlink: destName from: srcName
Create a symlink named destName file from the given path (relative to destName)

touch: fileName
Update the timestamp of the file with the given path name.


1.73.3 File class: initialization

initialize
Initialize the receiver's class variables


1.73.4 File class: instance creation

name: aName
Answer a new file with the given path. The path is turned into an absolute path.

path: aString
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


1.73.5 File class: reading system defaults

executable
Answer the full path to the executable being run.

image
Answer the full path to the image being used.


1.73.6 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


1.73.7 File: accessing

asString
Answer the name of the file identified by the receiver

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

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).

isDirectory
Answer whether the file is a directory.

isSocket
Answer whether the file is an AF_UNIX socket.

isSymbolicLink
Answer whether the file is a symbolic link.

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).

mode
Answer the permission bits for the file identified by the receiver

mode: anInteger
Set the permission bits for the file identified by the receiver to be anInteger.

name
Answer the name of the file identified by the receiver

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

refresh
Refresh the statistics for the receiver

size
Answer the size of the file identified by the receiver


1.73.8 File: basic

= aFile
Answer whether the receiver represents the same file as the receiver.

hash
Answer a hash value for the receiver.


1.73.9 File: directory operations

createDirectory
Create the receiver as a directory.

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


1.73.10 File: file name management

full
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')


1.73.11 File: file operations

lastAccessTime: accessDateTime lastModifyTime: modifyDateTime
Set the receiver's timestamps to be accessDateTime and modifyDateTime.

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

owner: ownerString group: groupString
Set the receiver's owner and group to be ownerString and groupString.

pathFrom: dir
Compute the relative path from the directory dirName to the receiver

remove
Remove the file with the given path name

renameTo: newFileName
Rename the file with the given path name to newFileName

symlinkAs: destName
Create destName as a symbolic link of the receiver. The appropriate relative path is computed automatically.

symlinkFrom: srcName
Create the receiver as a symlink from path destName


1.73.12 File: still unclassified

, aName
Answer an object of the same kind as the receiver, whose name is suffixed with aName.


1.73.13 File: testing

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

isAbsolute
Answer whether the receiver identifies an absolute path.

isAccessible
Answer whether a directory with the name contained in the receiver does exist and is accessible

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

isFileSystemPath
Answer whether the receiver corresponds to a real filesystem path.

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



Back: File-still unclassified Up: File Forward: FileDescriptor   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on August, 19 2010 using texi2html