Merge pull request #1658 from aarroyoc/copy_file

Add predicate file_copy/2 in library(files)
This commit is contained in:
Mark Thom
2022-12-18 21:22:25 +01:00
committed by GitHub
4 changed files with 36 additions and 2 deletions

View File

@@ -70,8 +70,9 @@ In this library, directories and files are represented as
file_exists/1,
directory_exists/1,
delete_file/1,
rename_file/2,
delete_directory/1,
rename_file/2,
file_copy/2,
delete_directory/1,
make_directory/1,
make_directory_path/1,
working_directory/2,
@@ -150,6 +151,14 @@ rename_file(File, Renamed) :-
must_be(chars, Renamed),
'$rename_file'(File, Renamed).
%% file_copy(+File, +Copied).
%
% Succeeds if File is copied to Copied
file_copy(File, Copied) :-
file_must_exist(File, file_copy/2),
must_be(chars, Copied),
'$file_copy'(File, Copied).
%% delete_directory(+Directory).
%
% Succeeds if Directory is deleted from the current system.