ADDED: file_modification_time/2, obtaining a time stamp.
This addresses a remaining aspect of #511.
This commit is contained in:
@@ -53,10 +53,12 @@
|
||||
delete_file/1,
|
||||
make_directory/1,
|
||||
working_directory/2,
|
||||
path_canonical/2]).
|
||||
path_canonical/2,
|
||||
file_modification_time/2]).
|
||||
|
||||
:- use_module(library(error)).
|
||||
:- use_module(library(lists)).
|
||||
:- use_module(library(charsio)).
|
||||
|
||||
list_of_chars(Cs) :-
|
||||
must_be(list, Cs),
|
||||
@@ -119,3 +121,12 @@ path_canonical(Ps, Cs) :-
|
||||
maplist(must_be(character), Ps),
|
||||
can_be(list, Cs),
|
||||
'$path_canonical'(Ps, Cs).
|
||||
|
||||
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
T is the modification time of File.
|
||||
T is a time stamp, suitable for use in format_time//2 in library(time).
|
||||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
file_modification_time(File, T) :-
|
||||
'$file_modification_time'(File, T0),
|
||||
read_term_from_chars(T0, T).
|
||||
|
||||
Reference in New Issue
Block a user