protocol
Portable operating-system access protocol.
Paulo Moura
1.23
2018/3/7
static
(no dependencies on other entities)
Returns the process identifier of the running process.
static
pid(PID)
pid(-integer) – one
Runs an operating-system shell command and returns its exit status.
static
shell(Command,Status)
shell(+atom,-integer) – one
Runs an operating-system shell command.
static
shell(Command)
shell(+atom) – zero_or_one
Expands a file name to an absolute file path. An environment variable at the beginning of the file name is also expanded.
static
absolute_file_name(File,Path)
absolute_file_name(+atom,-atom) – one
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).
static
decompose_file_name(File,Directory,Basename)
decompose_file_name(+atom,?atom,?atom) – one
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).
static
decompose_file_name(File,Directory,Name,Extension)
decompose_file_name(+atom,?atom,?atom,?atom) – one
Makes a new directory. Succeeds if the directory already exists.
static
make_directory(Directory)
make_directory(+atom) – one
Makes a new directory creating all the intermediate directories if necessary. Succeeds if the directory already exists.
static
make_directory_path(Directory)
make_directory_path(+atom) – one
Deletes an empty directory.
static
delete_directory(Directory)
delete_directory(+atom) – one
Changes current working directory.
static
change_directory(Directory)
change_directory(+atom) – one
Current working directory.
static
working_directory(Directory)
working_directory(?atom) – zero_or_one
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.
static
directory_files(Directory,Files)
directory_files(+atom,-list(atom)) – one
Returns a filtered list of files. Filters: paths/1 - relative/absolute, type/1 - all/regular/directory, extensions/1 - list, prefixes/1 - list, suffixes/1 - list, dot_files/1 - boolean. Invalid options ignored. Defaults equivalent to directory_files/2.
static
directory_files(Directory,Files,Options)
directory_files(+atom,-list(atom),+list(compound)) – one
True if the specified directory exists (irrespective of directory permissions).
static
directory_exists(Directory)
directory_exists(+atom) – zero_or_one
True if the specified file exists and is a regular file (irrespective of file permissions).
static
file_exists(File)
file_exists(+atom) – zero_or_one
File modification time (which can be used for comparison).
static
file_modification_time(File,Time)
file_modification_time(+atom,-integer) – zero_or_one
File size (in bytes).
static
file_size(File,Size)
file_size(+atom,-integer) – zero_or_one
True if the specified file has the specified permission (read, write, or execute).
static
file_permission(File,Permission)
file_permission(+atom,?atom) – zero_or_one
Renames a file or a directory.
static
rename_file(Old,New)
rename_file(+atom,+atom) – zero_or_one
Deletes a file.
static
delete_file(File)
delete_file(+atom) – one
Returns an environment variable value. Fails if the variable does not exists.
static
environment_variable(Variable,Value)
environment_variable(+atom,?atom) – zero_or_one
Returns a system-dependent time stamp, which can be used for sorting, but should be regarded otherwise as an opaque term.
static
time_stamp(Time)
time_stamp(-ground) – one
Returns the current date and time.
static
date_time(Year,Month,Day,Hours,Minutes,Seconds,Miliseconds)
date_time(-integer,-integer,-integer,-integer,-integer,-integer,-integer) – one
System cpu time in seconds.
static
cpu_time(Seconds)
cpu_time(-number) – one
Wall time in seconds.
static
wall_time(Seconds)
wall_time(-number) – one
Operating system type. Possible values are "unix", "windows", and "unknown".
static
operating_system_type(Type)
operating_system_type(?atom) – one
Returns a list with the command line arguments that occur after "--".
static
command_line_arguments(Arguments)
command_line_arguments(-list(atom)) – one
Suspends execution the given number of seconds.
static
sleep(Seconds)
sleep(+number) – one
(none)
(none)