Tom Ridge
2014-06-16 08:53:21 UTC
Dear List,
Two errors during path resolution are ENOENT and ENOTDIR. Intuitively
ENOENT arises for paths such as /a/b/c, where there is no file b.
ENOTDIR arises when there is a file b, but it is not a directory.
Looking at the specification for link, rename and other commands, the
specification is consistent with this intuition.
However, looking at mkdir, we have:
[ENOENT]
A component of the path prefix specified by path does not name an
existing directory or path is an empty string.
This seems to say that for mkdir, an ENOENT is allowed for a path
/a/b/c, where b exists and is a non-directory file. This runs against
the intuition and the behaviour of the other commands. Is this
intended?
For reference, the typical phrasing of the ENOENT clause (eg with link
command) is:
[ENOENT]
A component of either path prefix does not exist; the file named by
path1 does not exist; or path1 or path2 points to an empty string.
Thanks
Two errors during path resolution are ENOENT and ENOTDIR. Intuitively
ENOENT arises for paths such as /a/b/c, where there is no file b.
ENOTDIR arises when there is a file b, but it is not a directory.
Looking at the specification for link, rename and other commands, the
specification is consistent with this intuition.
However, looking at mkdir, we have:
[ENOENT]
A component of the path prefix specified by path does not name an
existing directory or path is an empty string.
This seems to say that for mkdir, an ENOENT is allowed for a path
/a/b/c, where b exists and is a non-directory file. This runs against
the intuition and the behaviour of the other commands. Is this
intended?
For reference, the typical phrasing of the ENOENT clause (eg with link
command) is:
[ENOENT]
A component of either path prefix does not exist; the file named by
path1 does not exist; or path1 or path2 points to an empty string.
Thanks