test.1 -> "if file exists" -> "if pathname resolves to an existing directory entry"

2024-07-23 Thread tlaronde
FWIW, the current test.1 man page could, IMHO, be improved by mimicking POSIX wording i.e. by replacing "if file exists" by the corresponding variant of "if pahtname resolves to an existing directory entry...". Context: I wondered how to test that a file exists in all cases, that is, if it is a sy

Re: test.1 -> "if file exists" -> "if pathname resolves to an existing directory entry"

2024-07-23 Thread Robert Elz
Date:Tue, 23 Jul 2024 16:16:46 +0200 From: Message-ID: | -e file True if file exists (regardless of type). | | let me wondering: what "file" is supposed to exist? The symlink by | itself? or what it points to? Note the following wording in test(1) j

Re: test.1 -> "if file exists" -> "if pathname resolves to an existing directory entry"

2024-07-23 Thread Mouse
> If you need a single (unraceable) test, that can often be achieved by > attempting to make a link to the target filename, as link(2) and > hence ln(1) without -f will fail if the target name exists. Yes, but it requires that you're running as a user which can write to the target filesystem, and,

Re: test.1 -> "if file exists" -> "if pathname resolves to an existing directory entry"

2024-07-23 Thread Robert Elz
Date:Tue, 23 Jul 2024 13:46:48 -0400 (EDT) From:Mouse Message-ID: <202407231746.naa19...@stone.rodents-montreal.org> | Yes, but it requires that you're running as a user which can write to | the target filesystem, and, if the target doesn't exist, it will create