[erlang-patches] Additional error-handling file:path_open/3

Thomas Järvstrand tjarvstrand@REDACTED
Sun Nov 4 15:54:18 CET 2012


Hi!

file:path_open/3 currently doesn't handle eisdir or enotdir return values
from file:open/2. Suppose we want to do path_open(["dir1", "dir2"],
"sub/file") and dir2/sub/file is the actual path of the file that we are
looking for. The effect of not handling these error cases is that the call
will fail if dir1 happens to contain either a regular file called sub
(file:open/2 returns enotdir) or a directory sub that in turn contains a
directory file (file:open/2 return eisdir).

This patch handles these extra error cases in file:path_open/3

Repo:
git fetch git@REDACTED:tjarvstrand/otp.git
additional-error-cases-in-path_open

Comparison:
https://github.com/tjarvstrand/otp/compare/additional-error-cases-in-path_open
https://github.com/tjarvstrand/otp/compare/additional-error-cases-in-path_open.patch

Regards
Thomas Järvstrand
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20121104/2aacb27a/attachment.htm>


More information about the erlang-patches mailing list