summaryrefslogtreecommitdiff
path: root/doc/ref
diff options
context:
space:
mode:
authorMichael Gran <spk121@yahoo.com>2021-01-19 05:00:49 -0800
committerMichael Gran <spk121@yahoo.com>2021-01-19 05:58:14 -0800
commitd98e1d5e4fd9a8d3d37b81d6dc71edabb6b2adae (patch)
tree699ee718764304c3e15741965b6e7e884e685c39 /doc/ref
parentd60ff39105199dc6c3da5a69c28a967fed2965ba (diff)
downloadguile-d98e1d5e4fd9a8d3d37b81d6dc71edabb6b2adae.tar.gz
New procedure mkdtemp! to create unique temporary directory
* configure.ac (AC_CHECK_FUNCS): add mkdtemp! test * doc/ref/posix.texi: document mkdtemp! * libguile/filesys.c (scm_mkdtemp_x): new function * libguile/filesys.h: new declaration for scm_mkdtemp_x * test-suite/tests/filesys.test: add tests for mkdtemp! Adapted from a patch by Rob Browning.
Diffstat (limited to 'doc/ref')
-rw-r--r--doc/ref/posix.texi21
1 files changed, 20 insertions, 1 deletions
diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi
index f34c5222d..8ea5baa5c 100644
--- a/doc/ref/posix.texi
+++ b/doc/ref/posix.texi
@@ -1,7 +1,7 @@
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007,
-@c 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2017 Free Software Foundation, Inc.
+@c 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2017, 2021 Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@node POSIX
@@ -1020,6 +1020,25 @@ The file is automatically deleted when the port is closed
or the program terminates.
@end deffn
+@deffn {Scheme Procedure} mkdtemp! tmpl
+@deffnx {C Function} scm_mkdtemp_x (tmpl)
+@cindex temporary directory
+Create a new directory named in accordance with the template string
+@var{tmpl}.
+
+@var{tmpl} is a string specifying the directory's name. The last six
+characters of @var{tmpl} must be @samp{XXXXXX}, characters that will be
+modified to ensure the directory name is unique. Upon successful
+execution, those @samp{X}s will be changed to reflect the name of the
+unique directory created.
+
+The permissions of the directory created are OS dependent, but, are
+usually @code{#o700}.
+
+The return value is unspecified. An error may be thrown if the template
+has the wrong format or if the directory cannot be created.
+@end deffn
+
@deffn {Scheme Procedure} dirname filename
@deffnx {C Function} scm_dirname (filename)
Return the directory name component of the file name