The UnixPath structure provides support for searching for files
in the Unix file system using a list of possible locations.
Note that this module is largely superseded by the
PathUtil module
in the Util Library.
Synopsis
signature UNIX_PATH
structure UnixPath : UNIX_PATH
Interface
type path_list = string list
val getPath : unit -> path_list
datatype access_mode = datatype OS.FileSys.access_mode
datatype file_type = F_REGULAR | F_DIR | F_SYMLINK | F_SOCK | F_CHR | F_BLK
val findFile : (path_list * access_mode list) -> string -> string option
val findFiles : (path_list * access_mode list) -> string -> string list
val findFileOfType : (path_list * file_type * access_mode list) -> string -> string option
val findFilesOfType : (path_list * file_type * access_mode list) -> string -> string list
Description
type path_list = string list-
A list of file-system paths that is used to search for files.
val getPath : unit -> path_list-
getPath ()return’s the value of the user’sPATHshell variable as apath_list. datatype access_mode = datatype OS.FileSys.access_mode-
Rebind the file-system access-mode constructors.
datatype file_type = F_REGULAR | F_DIR | F_SYMLINK | F_SOCK | F_CHR | F_BLK-
The different types of file-system objects in Unix.
val findFile : (path_list * access_mode list) -> string -> string option-
findFile (paths, mode) namereturnsSOME path, wherepathis a string of the form"p/name"andpis the first string inpathssuch thatpathhas the given access modes (the empty list of access modes is used to test for existence). If no such file exists, thenNONEis returned. val findFiles : (path_list * access_mode list) -> string -> string list-
findFiles (paths, mode) namereturns a list of strings, such that each stringsin the result has the form"p/name"withpinpathsand the file named bypathhas the specified access modes. val findFileOfType : (path_list * file_type * access_mode list) -> string -> string option-
findFileOfType (paths, ftype, mode) namereturns theSOME path, wherepathis a string of the form"p/name"andpis the first string inpathssuch thatpathhas the given access modes (the empty list of access modes is used to test for existence) and is of the specified file type. If no such file exists, thenNONEis returned. val findFilesOfType : (path_list * file_type * access_mode list) -> string -> string list-
findFilesOfType (paths, mode) namereturns a list of strings, such that each stringsin the result has the form"p/name"withpinpathsand the file named bypathhas the specified access modes and is of the specified file type.