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 withd
as its directory,n
as its name ande
as its extension. This is a portable way to create file names. Whend
ort
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 withd
as its directory,pref
as a prefix of its name ande
as its extension. Whend
ort
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.