diff options
author | Maxime Devos <maximedevos@telenet.be> | 2021-11-16 11:06:26 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-10-21 17:40:30 +0200 |
commit | 9ffd297249e8c99ac276b37c49725f6d2ef20b52 (patch) | |
tree | d0974e43939938c106d0976e4db7e616cd3e5af7 /doc/ref/posix.texi | |
parent | 30247dc414fb38329f580b1d41abbe202285adbe (diff) | |
download | guile-9ffd297249e8c99ac276b37c49725f6d2ef20b52.tar.gz |
Allow file ports in ‘utime’.
Ports representing symbolic links are currently unsupported.
* configure.ac: Detect 'futimens'.
* doc/ref/posix.texi (utime): Update documentation.
* libguile/posix.c (scm_utime): Support ports.
* libguile/posix.h (scm_utime): Rename argument.
* test-suite/tests/posix.test ("utime"): Add more tests.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc/ref/posix.texi')
-rw-r--r-- | doc/ref/posix.texi | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi index d2344d400..fbb59c720 100644 --- a/doc/ref/posix.texi +++ b/doc/ref/posix.texi @@ -814,14 +814,16 @@ the new permissions as a decimal number, e.g., @code{(chmod "foo" #o755)}. The return value is unspecified. @end deffn -@deffn {Scheme Procedure} utime pathname [actime [modtime [actimens [modtimens [flags]]]]] -@deffnx {C Function} scm_utime (pathname, actime, modtime, actimens, modtimens, flags) +@deffn {Scheme Procedure} utime object [actime [modtime [actimens [modtimens [flags]]]]] +@deffnx {C Function} scm_utime (object, actime, modtime, actimens, modtimens, flags) @code{utime} sets the access and modification times for the -file named by @var{pathname}. If @var{actime} or @var{modtime} is +file named by @var{object}. If @var{actime} or @var{modtime} is not supplied, then the current time is used. @var{actime} and @var{modtime} must be integer time values as returned by the @code{current-time} procedure. +@var{object} must be a file name or a port (if supported by the system). + The optional @var{actimens} and @var{modtimens} are nanoseconds to add @var{actime} and @var{modtime}. Nanosecond precision is only supported on some combinations of file systems and operating @@ -835,9 +837,14 @@ modification time to the current time. @vindex AT_SYMLINK_NOFOLLOW Last, @var{flags} may be either @code{0} or the @code{AT_SYMLINK_NOFOLLOW} constant, to set the time of -@var{pathname} even if it is a symbolic link. +@var{object} even if it is a symbolic link. @end deffn +On GNU/Linux systems, at least when using the Linux kernel 5.10.46, +if @var{object} is a port, it may not be a symbolic link, +even if @code{AT_SYMLINK_NOFOLLOW} is set. This is either a bug +in Linux or Guile's wrappers. The exact cause is unclear. + @findex unlink @deffn {Scheme Procedure} delete-file str @deffnx {C Function} scm_delete_file (str) |