diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-05-31 06:38:49 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-05-31 06:38:49 -0700 |
commit | 93454f1fc069d7d5a0af7b2aa1c773949b59d106 (patch) | |
tree | 53f654bb639ea56bd623c1abdd971f0be965a42c /txr.1 | |
parent | 6e696ffb297ab0066cc4f6deeda0c14b887a89fd (diff) | |
download | txr-93454f1fc069d7d5a0af7b2aa1c773949b59d106.tar.gz txr-93454f1fc069d7d5a0af7b2aa1c773949b59d106.tar.bz2 txr-93454f1fc069d7d5a0af7b2aa1c773949b59d106.zip |
New function: tmpfile.
* stream.c (tmpfile_wrap): New static function.
(stream_init): Register tmpfile intrinsic.
* stream.h (tmpfile_wrap): Declared.
* txr.1: Documented.
* share/txr/stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -55022,6 +55022,32 @@ and .code .. entries in Unix filesystems are not skipped. +.coNP Function @ tmpfile +.synb +.mets (tmpfile) +.syne +.desc +The +.code tmpfile +function creates a new temporary binary file which is different from any +existing file. It opens a stream for that file and returns the stream. The +stream is created with the +.code open-file +mode +.strn w+b . +When the stream is closed, or the \*(TX image terminates, the file is deleted. + +Note: the +.code tmpfile +function is implemented using the same-named ISO C and POSIX library function. +On POSIX systems of sufficient quality, +.code tmpfile +deletes the file before returning the open stream, such that the file object +continues to exist while the stream is open, but is not known by any name +in the file system. POSIX (IEEE Std 1003.1-2017) notes that in some +implementations, "a permanent file may be left behind if the process calling +tmpfile() is killed while it is processing a call to tmpfile". + .coNP Function @ make-string-input-stream .synb .mets (make-string-input-stream << string ) |