FileNameCategoryΒΆ

fname.spad line 1 [edit on github]

This category provides an interface to names in the file system.

=: (%, %) -> Boolean

from BasicType

~=: (%, %) -> Boolean

from BasicType

coerce: % -> OutputForm

from CoercibleTo OutputForm

coerce: % -> String

coerce(fn) produces a string for a file name according to operating system-dependent conventions.

coerce: String -> %

coerce(s) converts a string to a file name according to operating system-dependent conventions.

directory: % -> String

directory(f) returns the directory part of the file name.

exists?: % -> Boolean

exists?(f) tests if the file exists in the file system.

extension: % -> String

extension(f) returns the type part of the file name.

filename: (String, String, String) -> %

filename(d, n, e) creates a file name with d as its directory, n as its name and e as its extension. This is a portable way to create file names. When d or t is the empty string, a default is used.

latex: % -> String

from SetCategory

name: % -> String

name(f) returns the name part of the file name.

new: (String, String, String) -> %

new(d, pref, e) constructs the name of a new writable file with d as its directory, pref as a prefix of its name and e as its extension. When d or t is the empty string, a default is used. An error occurs if a new file cannot be written in the given directory.

readable?: % -> Boolean

readable?(f) tests if the named file exist and can it be opened for reading.

writable?: % -> Boolean

writable?(f) tests if the named file be opened for writing. The named file need not already exist.

BasicType

CoercibleTo OutputForm

SetCategory