/usr/local/lib/swipl/library/ext/clib/filesex.pl
All Application Manual Name SummaryHelp

  • ext
    • clib
      • socket.pl -- Network socket (TCP and UDP) library
      • uid.pl -- User and group management on Unix systems
      • unix.pl -- Unix specific operations
      • syslog.pl -- Unix syslog interface
      • memfile.pl
      • time.pl -- Time and alarm library
      • uri.pl -- Process URIs
      • filesex.pl -- Extended operations on files
        • set_time_file/3
        • link_file/3
        • relative_file_name/3
        • directory_file_path/3
        • directory_member/3
        • copy_file/2
        • make_directory_path/1
        • ensure_directory/1
        • copy_directory/2
        • delete_directory_and_contents/1
        • delete_directory_contents/1
        • chmod/2
      • uuid.pl -- Universally Unique Identifier (UUID) Library
      • sha.pl -- SHA secure hashes
      • process.pl -- Create processes and redirect I/O
      • hash_stream.pl -- Maintain a hash on a stream
      • md5.pl -- MD5 hashes
      • mallocinfo.pl -- Memory allocation details
      • streampool.pl -- Input multiplexing
      • prolog_stream.pl -- A stream with Prolog callbacks
      • crypt.pl
      • udp_broadcast.pl -- A UDP broadcast proxy
 set_time_file(+File, -OldTimes, +NewTimes) is det
Query and set POSIX time attributes of a file. Both OldTimes and NewTimes are lists of option-terms. Times are represented in SWI-Prolog's standard floating point numbers. New times may be specified as now to indicate the current time. Defined options are:
access(Time)
Describes the time of last access of the file. This value can be read and written.
modified(Time)
Describes the time the contents of the file was last modified. This value can be read and written.
changed(Time)
Describes the time the file-structure itself was changed by adding (link()) or removing (unlink()) names.

Below are some example queries. The first retrieves the access-time, while the second sets the last-modified time to the current time.

?- set_time_file(foo, [access(Access)], []).
?- set_time_file(foo, [], [modified(now)]).