protocol
osp¶
Portable operating-system access protocol.
staticPublic predicates¶
pid/1¶
Returns the process identifier of the running process.
staticpid(PID)pid(-integer) - oneshell/2¶
Runs an operating-system shell command and returns its exit status.
staticshell(Command,Status)shell(+atom,-integer) - oneshell/1¶
Runs an operating-system shell command.
staticshell(Command)shell(+atom) - zero_or_oneabsolute_file_name/2¶
Expands a file name to an absolute file path. An environment variable at the beginning of the file name is also expanded.
staticabsolute_file_name(File,Path)absolute_file_name(+atom,-atom) - onedecompose_file_name/3¶
Decomposes a file name into its directory (which always ends with a slash; ./ is returned if absent) and its basename (that can be the empty atom).
staticdecompose_file_name(File,Directory,Basename)decompose_file_name(+atom,?atom,?atom) - onedecompose_file_name/4¶
Decomposes a file name into its directory (which always ends with a slash; ./ is returned if absent), name (that can be the empty atom), and extension (which starts with a . when defined; the empty atom otherwise).
staticdecompose_file_name(File,Directory,Name,Extension)decompose_file_name(+atom,?atom,?atom,?atom) - onepath_concat/3¶
Concatenates a path prefix and a path suffix, adding a / separator if required. Returns Suffix when it is an absolute path. Returns Prefix with a trailing / appended if missing when Suffix is the empty atom.
staticpath_concat(Prefix,Suffix,Path)path_concat(+atom,+atom,--atom) - onemake_directory/1¶
Makes a new directory. Succeeds if the directory already exists.
staticmake_directory(Directory)make_directory(+atom) - onemake_directory_path/1¶
Makes a new directory creating all the intermediate directories if necessary. Succeeds if the directory already exists.
staticmake_directory_path(Directory)make_directory_path(+atom) - onedelete_directory/1¶
Deletes an empty directory.
staticdelete_directory(Directory)delete_directory(+atom) - onechange_directory/1¶
Changes current working directory.
staticchange_directory(Directory)change_directory(+atom) - oneworking_directory/1¶
Current working directory.
staticworking_directory(Directory)working_directory(?atom) - zero_or_onetemporary_directory/1¶
Temporary directory. Tries first environment variables: TEMP and TMP on Windows systems; TMPDIR, TMP, TEMP, and TEMPDIR on POSIX systems. When not defined, tries default locations. Returns the working directory as last resort.
statictemporary_directory(Directory)temporary_directory(?atom) - onenull_device_path/1¶
Null device path: nul on Windows systems and /dev/null on POSIX systems.
staticnull_device_path(Path)null_device_path(?atom) - onedirectory_files/2¶
Returns a list of all files (including directories, regular files, and hidden directories and files) in a directory. File paths are relative to the directory.
staticdirectory_files(Directory,Files)directory_files(+atom,-list(atom)) - onedirectory_files/3¶
Returns a list of files filtered using the given list of options. Invalid options are ignored. Default option values are equivalent to directory_files/2.
staticdirectory_files(Directory,Files,Options)directory_files(+atom,-list(atom),+list(compound)) - one
Option
paths/1: Possible values arerelativeandabsolute. Default isrelative.Option
type/1: Possible values areall,regular,directory. Default isall.Option
extensions/1: Argument is a list of required extensions (using the format'.ext'). Default is the empty list.Option
prefixes/1: Argument is a list of required file prefixes (atoms). Default is the empty list.Option
suffixes/1: Argument is a list of required file suffixes (atoms). Default is the empty list.Option
dot_files/1: Possible values aretrueandfalse. Default istrue.
directory_exists/1¶
True if the specified directory exists (irrespective of directory permissions).
staticdirectory_exists(Directory)directory_exists(+atom) - zero_or_oneensure_directory/1¶
Ensures that a directory exists, creating it if necessary.
staticensure_directory(Directory)ensure_directory(+atom) - onefile_exists/1¶
True if the specified file exists and is a regular file (irrespective of file permissions).
staticfile_exists(File)file_exists(+atom) - zero_or_onefile_modification_time/2¶
File modification time (which can be used for comparison).
staticfile_modification_time(File,Time)file_modification_time(+atom,-integer) - zero_or_onefile_size/2¶
File size (in bytes).
staticfile_size(File,Size)file_size(+atom,-integer) - zero_or_onefile_permission/2¶
True if the specified file has the specified permission (read, write, or execute).
staticfile_permission(File,Permission)file_permission(+atom,?atom) - zero_or_onerename_file/2¶
Renames a file or a directory.
staticrename_file(Old,New)rename_file(+atom,+atom) - zero_or_onedelete_file/1¶
Deletes a file.
staticdelete_file(File)delete_file(+atom) - oneensure_file/1¶
Ensures that a file exists, creating it if necessary.
staticensure_file(File)ensure_file(+atom) - oneenvironment_variable/2¶
Returns an environment variable value. Fails if the variable does not exists.
staticenvironment_variable(Variable,Value)environment_variable(+atom,?atom) - zero_or_onetime_stamp/1¶
Returns a system-dependent time stamp, which can be used for sorting, but should be regarded otherwise as an opaque term.
statictime_stamp(Time)time_stamp(-ground) - onedate_time/7¶
Returns the current date and time.
staticdate_time(Year,Month,Day,Hours,Minutes,Seconds,Milliseconds)date_time(-integer,-integer,-integer,-integer,-integer,-integer,-integer) - onecpu_time/1¶
System cpu time in seconds.
staticcpu_time(Seconds)cpu_time(-number) - onewall_time/1¶
Wall time in seconds.
staticwall_time(Seconds)wall_time(-number) - oneoperating_system_type/1¶
Operating system type. Possible values are unix, windows, and unknown.
staticoperating_system_type(Type)operating_system_type(?atom) - onecommand_line_arguments/1¶
Returns a list with the command line arguments that occur after --.
staticcommand_line_arguments(Arguments)command_line_arguments(-list(atom)) - oneProtected predicates¶
(none)
Private predicates¶
(none)