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’sPATH
shell 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) name
returnsSOME path
, wherepath
is a string of the form"p/name"
andp
is the first string inpaths
such thatpath
has the given access modes (the empty list of access modes is used to test for existence). If no such file exists, thenNONE
is returned. val findFiles : (path_list * access_mode list) -> string -> string list
-
findFiles (paths, mode) name
returns a list of strings, such that each strings
in the result has the form"p/name"
withp
inpaths
and the file named bypath
has the specified access modes. val findFileOfType : (path_list * file_type * access_mode list) -> string -> string option
-
findFileOfType (paths, ftype, mode) name
returns theSOME path
, wherepath
is a string of the form"p/name"
andp
is the first string inpaths
such thatpath
has 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, thenNONE
is returned. val findFilesOfType : (path_list * file_type * access_mode list) -> string -> string list
-
findFilesOfType (paths, mode) name
returns a list of strings, such that each strings
in the result has the form"p/name"
withp
inpaths
and the file named bypath
has the specified access modes and is of the specified file type.