[erlang-bugs] filelib:ensure_dir/1 and symlink to dir

Danil Zagoskin z@REDACTED
Sun Jun 29 23:02:25 CEST 2014


For example, I have a directory "foo" and a symlink "bar" to "foo".
While I can access file, I get error trying to ensure_dir:
2> file:read_file("bar/baz").
{ok,<<>>}
3> filelib:ensure_dir("bar/baz").
{error,eexist}

This is because filelib:do_is_dir/2 does not expect a symlink to dir.

Is it expected behavior or should I submit a patch for that?
(This breaks at least lager which does filelib:ensure_dir before opening a
log)

-- 
Danil Zagoskin | z@REDACTED
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140630/98e39880/attachment.htm>


More information about the erlang-bugs mailing list