protocol
Portable operating-system access protocol.
Paulo Moura
1.13
2015/10/16
static
(no dependencies on other files)
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 path to an absolute file path.
static
expand_path(Path,ExpandedPath)
expand_path(+atom,-atom) – one
Decomposes a file path into its directory (which always ends with a slash), name (that can be the empty atom), and extension (which starts with a "." when defined; the empty atom otherwise).
static
decompose_file_name(Path,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
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 the files (including directories and regular files) in the given directory.
static
directory_files(Directory,Files)
directory_files(+atom,-list(atom)) – 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 (irrespective of type and 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).
static
time_stamp(Time)
time_stamp(-number) – one
Returns the current date and time.
static
date_time(Year,Month,Day,Hours,Mins,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
(none)
(none)