FileNameCategoryΒΆ
fname.spad line 1 [edit on github]
This category provides an interface to names in the file system.
- 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 withdas its directory,nas its name andeas its extension. This is a portable way to create file names. Whendortis 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 withdas its directory,prefas a prefix of its name andeas its extension. Whendortis 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.