'tac' trying to use "/tmp"; Error: not found

Brian Inglis Brian.Inglis@Shaw.ca
Mon Apr 3 15:29:46 GMT 2023


On 2023-04-02 21:22, marco atzeri wrote:
> On Sun, Apr 2, 2023 at 9:43 PM Prof. Luis G. Uribe C. wrote:
>> *|  'tac'  utility dies with a not found "/tmp" error.  |*

It is preferable to copy the exact command(s) and output into your problem 
report. Presumably the input is a pipe or non-seekable device which needs 
buffered in a temp file.

>>    I didn't see this problem in older 'tac' versions...
>>    I created "/tmp" under my root directory:
>> *    "c:\tmp"* (Windows 10), *to no avail*.
>>    I make a  *tmp*  dir directly *above*, in the *parent's 'tac' dir*:
>>       *"../tmp"*, at the same level as other usual folders like:
>>          *bin*, *dev*, *etc*, *lib*, *sbin*...,
>>    and now: *'**tac' works fine**!*

The /tmp directory needs to be created in the Cygwin POSIX root directory "/".

[I am surprised GNU tac does not yet use mmap where available, as an alternative 
to seek, as mmap has been around for decades, since 4.4BSD, SysVr4, and Solaris 
2.0 days, and should be faster on huge files.]

> The expectation for the existence of /tmp directory is well founded
> https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
> I assume by accident your installation pruned the directory.
> I will not be surprised if other programs also complain, not only tac

You can point to another dir under a shell (or export the env var) using e.g.

	$ export TMPDIR=${TMP:-${TEMP:-/tmp}}
or
	$ TMPDIR=. tac ...

If you have Cygwin bash and coreutils installed, under bash or a similar shell 
with brace expansion you can restore the install directories with:

	$ /bin/mkdir -pv -m 0755 /{bin,dev,etc,lib} \
		/usr/{bin,lib,local/{bin,etc,lib},src}
	$ /bin/mkdir -pv -m 01777 /dev/{mqueue,shm} /etc/fstab.d \
		/{home,{,usr/}tmp} /var/{log,run,tmp}
	$ /bin/mkdir -pv -m 0666 /var/run/utmp
see:
	https://cygwin.com/git/?p=cygwin-apps/setup.git;a=blob;f=install.cc#l156

If the directories do not have the correct permissions, use chmod to fix them.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


More information about the Cygwin mailing list