NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/47333: stat -L undocumented behavior



The following reply was made to PR bin/47333; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/47333: stat -L undocumented behavior
Date: Sat, 03 May 2025 17:55:11 +0700

     Date:        Fri,  2 May 2025 19:20:01 +0000 (UTC)
     From:        "Jeremy C. Reed via gnats" <gnats-admin%NetBSD.org@localhost>
     Message-ID:  <20250502192001.4F7D71A923C%mollari.NetBSD.org@localhost>
 
   |  This ticket is over a decade old. But the change is over two decades
   |  so maybe we should just document it.
 
 That's what we should do, making it return an error makes it
 harder to tell the difference between
 
 	stat -L doesnotexist
 and
 	stat -L linktest
 
 (using the names from the test).
 
 That is, in this example:
 
 	reed@ns1:~$ stat -L linktest 
 	stat: cannot statx 'linktest': No such file or directory
 
 is it linktest that does not exist, or the target of linktest?
 The only way to know is to do another command.
 
 The test for a symlink which points to non-existent files is just
 
 	test "$(stat -Lf%t linkname)" = @
 
 That's simple, easy, and unambiguous, and only requires a single
 command (regardless of what "linkname" might happen to be).
 
 kre
 


Home | Main Index | Thread Index | Old Index