diff options
author | Maxime Devos <maximedevos@telenet.be> | 2021-11-16 11:06:31 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-10-21 17:40:37 +0200 |
commit | 3a0554c60fb12857c67d2eb0bd04cf8c59014f55 (patch) | |
tree | 8ddc86f7fb394840c3a04815c571348ceed908e8 /doc/ref | |
parent | 24028e75ca6c184051ee9543ceefeefe628c025b (diff) | |
download | guile-3a0554c60fb12857c67d2eb0bd04cf8c59014f55.tar.gz |
Define a Scheme binding to ‘renameat’ when it exists.
* configure.ac: Detect if ‘renameat’ is defined.
* libguile/filesys.c (scm_renameat): Define a Scheme binding
to the ‘renameat’ system call.
* doc/ref/posix.texi (File System): Document it.
* libguile/filesys.h (scm_renameat): Make it part of the C API.
* test-suite/tests/filesys.test ("rename-file-at"): New tests.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc/ref')
-rw-r--r-- | doc/ref/posix.texi | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi index 93bb4d459..85da56ca8 100644 --- a/doc/ref/posix.texi +++ b/doc/ref/posix.texi @@ -895,6 +895,15 @@ Renames the file specified by @var{oldname} to @var{newname}. The return value is unspecified. @end deffn +@findex renameat +@deffn {Scheme Procedure} rename-file-at olddir oldname newdir newname +@deffnx {C Function} scm_renameat (olddir, oldname, newdir, newname) +Like @code{rename-file}, but when @var{olddir} or @var{newdir} is true, +resolve @var{oldname} or @var{newname} relative to the directory +specified by the file port @var{olddir} or @var{newdir} instead of the +current working directory. +@end deffn + @deffn {Scheme Procedure} link oldpath newpath @deffnx {C Function} scm_link (oldpath, newpath) Creates a new name @var{newpath} in the file system for the |