Summary: | document that file(1) succeeds when the file doesn't exist | ||
---|---|---|---|
Product: | Documentation | Reporter: | Yuri Victorovich <yuri> |
Component: | Manual Pages | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Closed Overcome By Events | ||
Severity: | Affects Some People | CC: | 0mp, bcr, doc, lgfbsd |
Priority: | --- | Keywords: | easy, feature, needs-patch |
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any |
Description
Yuri Victorovich
2018-04-23 05:17:19 UTC
I believe this is correct POSIX behavior: " If the file named by the file operand does not exist, cannot be read, or the type of the file named by the file operand cannot be determined, this shall not be considered an error that affects the exit status. " An appropriate fix would be to add that text to our manual page. (In reply to lgfbsd from comment #1) I agree. The EXIT STATUS section on current file(1) versions includes this: EXIT STATUS file will exit with 0 if the operation was successful or >0 if an error was encountered. The following errors cause diagnostic messages, but don't affect the program exit code (as POSIX requires), unless -E is specified: • A file cannot be found • There is no permission to read a file • The file type cannot be determined I think that covers the issue of this PR. Thanks for submitting it, it was fixed in the meantime. Sorry it took so long to close it. |