Next: , Up: FilePath   [Index]


1.77.1 FilePath class: file name management

append: fileName to: directory

Answer the name of a file named ‘fileName’ which resides in a directory named ‘directory’.

extensionFor: aString

Answer the extension of a file named ‘aString’. Note: the extension includes an initial dot.

fullNameFor: aString

Answer the full path to a file called ‘aString’, resolving the ‘.’ and ‘..’ directory entries, and answer the result. ‘/..’ is the same as ’/’.

pathFor: aString

Determine the path of the name of a file called ‘aString’, and answer the result. With the exception of the root directory, the final slash is stripped.

pathFor: aString ifNone: aBlock

Determine the path of the name of a file called ‘aString’, and answer the result. With the exception of the root directory, the final slash is stripped. If there is no path, evaluate aBlock and return the result.

pathFrom: srcName to: destName

Answer the relative path to destName when the current directory is srcName’s directory.

stripExtensionFrom: aString

Remove the extension from the name of a file called ‘aString’, and answer the result.

stripFileNameFor: aString

Determine the path of the name of a file called ‘aString’, and answer the result as a directory name including the final slash.

stripPathFrom: aString

Remove the path from the name of a file called ‘aString’, and answer the file name plus extension.