]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: split,tac: document $TMPDIR usage
authorPádraig Brady <P@draigBrady.com>
Thu, 18 Dec 2025 23:54:52 +0000 (23:54 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 19 Dec 2025 00:09:58 +0000 (00:09 +0000)
Following commit v9.3-92-g1b86b70dd
$TMPDIR is part of the interface and an important behavioral
characteristic of a command, which should be documented.

* doc/coreutils.texi (split invocation): Mention $TMPDIR is honored.
(tac invocation): Likewise.
* src/split.c (usage): Likewise.
* src/tac.c (usage): Likewise.

doc/coreutils.texi
src/split.c
src/tac.c

index e0ff401e2bdc7d675d94eff4664fda7d7992bc9b..d31c80859581345fcd1ef2ee3e599ad53da5ad95 100644 (file)
@@ -1837,6 +1837,11 @@ I.e., input and output items are delimited with ASCII NUL.
 On systems like MS-DOS that distinguish between text and binary files,
 @command{tac} reads and writes in binary mode.
 
+@vindex TMPDIR
+Non-seekable input is buffered to @env{$TMPDIR}, defaulting to @file{/tmp},
+if the @env{TMPDIR} environment variable is not set
+or the location is not available.
+
 @exitstatus
 
 Example:
@@ -3346,10 +3351,13 @@ are not split even if they overlap a partition, the files written
 can be larger or smaller than the partition size, and even empty
 if a line/record is so long as to completely overlap the partition.
 
+@vindex TMPDIR
 When the input is a pipe or some other special file where the size
 cannot easily be determined, there is no trouble for @samp{r} mode
-because the size of the input is irrelevant.  For other modes, such an
-input is first copied to a temporary to determine its size.
+because the size of the input is irrelevant.  For other modes,
+such an input's size is determined by first copying to @env{$TMPDIR},
+or @file{/tmp} if the @env{TMPDIR} environment variable is not set
+or the location is not available.
 
 @optItem{split,-a,@w{ }@var{length}}
 @optItemx{split,--suffix-length,=@var{length}}
index d383f1ef90e0647fe2f93e58cc6f84feafecb05c..58a880b28ed9df4487731c76c80909ff4a28cafd 100644 (file)
@@ -268,6 +268,10 @@ CHUNKS may be:\n\
   l/K/N   output Kth of N to standard output without splitting lines/records\n\
   r/N     like 'l' but use round robin distribution\n\
   r/K/N   likewise but only output Kth of N to standard output\n\
+"), stdout);
+      fputs (_("\n\
+-n (except -nr) will buffer to $TMPDIR, defaulting to /tmp,\n\
+if the input size cannot easily be determined.\n\
 "), stdout);
       emit_ancillary_info (PROGRAM_NAME);
     }
index e049331592049590b39642304122a27c9677bdc7..000cad1af080951b51dd83489ef55f8c8835b8c1 100644 (file)
--- a/src/tac.c
+++ b/src/tac.c
@@ -133,6 +133,9 @@ Write each FILE to standard output, last line first.\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
+      fputs (_("\n\
+Non-seekable input is buffered to $TMPDIR, defaulting to /tmp.\n\
+"), stdout);
       emit_ancillary_info (PROGRAM_NAME);
     }
   exit (status);