bug-bash
[Top][All Lists]
Advanced

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

Re: Bash handling of ENOENT on missing files and directories


From: PePa
Subject: Re: Bash handling of ENOENT on missing files and directories
Date: Mon, 9 Oct 2017 07:49:05 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 10/09/2017 05:30 AM, Jonny Grant wrote:
Fair enough. I agree it has been around for longer, but meant that POSIX standardized on that limitation, and didn't offer a better solution that clarified, eg ENOENTF ENOENTD

I'm guessing not making the distinction saved a bit of CPU.

yes, a clearer errno value, for files, and separate for directories would be ideal.

Would have been better.

Has anyone ever wanted to "cd" into a file?

$ cd file
-bash: cd: file: Not a directory

In this case it tested whether 'file' is a directory. When trying 'cd' into 'missingdir', the result is that an entry 'missingdir' couldn't be found, whether file or directory. This is actually more informative.

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]