Add rename_file/2 predicate to the files library

This commit is contained in:
Paulo Moura
2021-05-18 18:08:30 +01:00
parent 0eeae24049
commit 58555d598b
3 changed files with 22 additions and 0 deletions

View File

@@ -51,6 +51,7 @@
file_exists/1,
directory_exists/1,
delete_file/1,
rename_file/2,
delete_directory/1,
make_directory/1,
make_directory_path/1,
@@ -101,6 +102,12 @@ delete_file(File) :-
list_of_chars(File),
'$delete_file'(File).
rename_file(File, Renamed) :-
file_must_exist(File, rename_file/2),
list_of_chars(File),
list_of_chars(Renamed),
'$rename_file'(File, Renamed).
delete_directory(Directory) :-
directory_must_exist(Directory, delete_directory/1),
list_of_chars(Directory),