Additional operating system utilities

Author(s): Manuel Hermenegildo.

This is a (temporary) extension to library system (which it reexports). It implements functionality that is often convenient in Makefiles. Much of this should probably end up eventually in system, but once we have worked out the best interface and, in some cases, the proper implementation (the implementations in here are in some cases just calls to Un*x shell primitives or commands).

Documentation on exports

PREDICATE
No further documentation available for this predicate.

PREDICATE
move_files(Files,Dir)

Move Files to directory Dir (note that to move only one file to a directory, rename_file/2 can be used).

Usage:

  • The following properties should hold at call time:
    (basic_props:list/2)Files is a list of atms.
    (basic_props:atm/1)Dir is an atom.

PREDICATE
No further documentation available for this predicate.

PREDICATE
copy_files(Files,Dir)

Copy Files to directory Dir (note that to move only one file to a directory, rename_file/2 can be used).

Usage:

  • The following properties should hold at call time:
    (basic_props:list/2)Files is a list of atms.
    (basic_props:atm/1)Dir is an atom.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE

Usage: symbolic_link(Source,Dir)

  • Description: Create a symbolic link in Dir pointing to file or directory Source (performs a copy in Windows).

PREDICATE

Usage: symbolic_link(Source,Dir,NewName)

  • Description: Create a symbolic link in Dir pointing to file or directory Source and give it name NewName (performs a copy in Windows).

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
ls(Directory,Pattern,FileList)

FileList is the unordered list of entries (files, directories, etc.) in Directory whose names match Pattern.If Directory does not exist FileList is empty.

Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)Directory is an atom.
    (system_extra:pattern/1)system_extra:pattern(Pattern)
    (term_typing:var/1)FileList is a free variable.
  • The following properties hold upon exit:
    (basic_props:list/2)FileList is a list of atms.

PREDICATE
ls(Pattern,FileList)

FileList is the unordered list of entries (files, directories, etc.) in the current directory whose names match Pattern (same as ls('.',Pattern,FileList)).

Usage:

  • The following properties should hold at call time:
    (system_extra:pattern/1)system_extra:pattern(Pattern)
    (term_typing:var/1)FileList is a free variable.
  • The following properties hold upon exit:
    (basic_props:list/2)FileList is a list of atms.

PREDICATE
filter_alist_pattern(UnFiltered,Pattern,Filtered)

Filtered contains the elements of UnFiltered which match with Pattern.

Usage:

  • The following properties should hold at call time:
    (basic_props:list/2)UnFiltered is a list of atms.
    (system_extra:pattern/1)system_extra:pattern(Pattern)
    (term_typing:var/1)Filtered is a free variable.
  • The following properties hold upon exit:
    (basic_props:list/2)Filtered is a list of atms.

PREDICATE
No further documentation available for this predicate.
Meta-predicate with arguments: -goal.

PREDICATE
No further documentation available for this predicate.
Meta-predicate with arguments: --goal.

PREDICATE

Usage: do(Command,Action)

  • Description: Same as do/3 but omitting the return code.
  • The following properties should hold at call time:
    (basic_props:list/2)Command is a list of atms.
    (basic_props:list/2)Action is a list of do_optionss.

PREDICATE

Usage: do(Command,Action,ReturnCode)

  • Description: Same as do/5 but omitting the files.
  • The following properties should hold at call time:
    (basic_props:list/2)Command is a list of atms.
    (basic_props:list/2)Action is a list of do_optionss.
  • The following properties should hold upon exit:
    (basic_props:num/1)ReturnCode is a number.

PREDICATE

Usage: do(Command,OutputFile,ErrorFile,Action)

  • Description: Same as do/5 but omitting the returned code.
  • The following properties should hold at call time:
    (basic_props:list/2)Command is a list of atms.
    (basic_props:atm/1)OutputFile is an atom.
    (basic_props:atm/1)ErrorFile is an atom.
    (basic_props:list/2)Action is a list of do_optionss.

PREDICATE

Usage: do(Command,OutputFile,ErrorFile,Action,ReturnCode)

  • Description: Executes Command redirecting standard output to OutputFile and standard error to ErrorFile. ReturnCode is the code returned by the execution of Command. Action is a list of atoms that specify the actions to be completed in case the Command fails. Three of these options: fail, exception, and nofail are mutually exclusive. The rest of the options are flags that mean (type do_options/1):

  • inform_nofail: informs about the error code returned by the execution of the command.

  • show_output_on_error: shows the content of OutputFile in case of error.

  • show_error: shows the content of ErrorFile in case of error.

  • silent: do not print any error message. The option inform_nofail overrides this option in case of fail.

  • verbose_command: shows the command before being executed. Useful for tracing.

  • verbose: verbose_command plus overrides the error and output file settings and outputs everything to user_output and user_error.

  • The following properties should hold at call time:
    (basic_props:list/2)Command is a list of atms.
    (basic_props:atm/1)OutputFile is an atom.
    (basic_props:atm/1)ErrorFile is an atom.
    (basic_props:list/2)Action is a list of do_optionss.
  • The following properties should hold upon exit:
    (basic_props:num/1)ReturnCode is a number.

PREDICATE

Meta-predicate with arguments: try_finally(goal,goal,goal).

Usage: try_finally(Start,Goal,End)

  • Description: Calls initialization goal Start and then calls Goal Goal, but always continues with the evaluation of End. If Goal is non-deterministic, in case of backtracking Start is called again before redoing Goal.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
any_to_term(Any,Term)

Interprets the result of print Any as a term Term

PREDICATE
touch(File)

Updates the access and modification time of File to current time.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

REGTYPE
A regular type, defined as follows:
pattern(A) :-
        atom(A).

REGTYPE
A regular type, defined as follows:
do_options(fail).
do_options(nofail).
do_options(silent).
do_options(exception).
do_options(halt).
do_options(inform_nofail).
do_options(show_output_on_error).
do_options(show_error_on_error).
do_options(verbose).
do_options(verbose_command).

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

PREDICATE
No further documentation available for this predicate.

(UNDOC_REEXPORT)
system_error_report/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
replace_characters/4:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
no_swapslash/3:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
cyg2win/3:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
winpath_c/3:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
winpath/3:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
winpath/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
using_windows/0:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
rename_file/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
delete_directory/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
delete_file/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
set_exec_mode/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
chmod/3:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
chmod/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
fmode/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
modif_time0/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
modif_time/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
file_properties/6:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
file_property/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
file_exists/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
file_exists/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
mktemp_in_tmp/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
mktemp/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
directory_files/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
wait/3:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
exec/8:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
exec/3:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
exec/4:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
popen_mode/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
popen/3:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
system/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
system/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
shell/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
shell/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
shell/0:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
cd/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
working_directory/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
make_dirpath/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
make_dirpath/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
make_directory/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
make_directory/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
umask/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
current_executable/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
current_host/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
get_address/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
get_tmp_dir/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
get_grnam/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
get_pwnam/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
get_gid/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
get_uid/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
get_pid/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
file_dir_name/3:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
extract_paths/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
dir_path/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
copy_file/3:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
copy_file/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
c_errno/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
del_env/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
set_env/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
current_env/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
setenvstr/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
getenvstr/2:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
datime_struct/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
datime/9:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
datime/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
time/1:
Imported from system (see the corresponding documentation for details).

(UNDOC_REEXPORT)
pause/1:
Imported from system (see the corresponding documentation for details).