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

Thomas Järvstrand <>
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 :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.html>


More information about the erlang-patches mailing list