[erlang-questions] symlink error (I think)

Joe Armstrong <>
Mon Apr 15 12:28:15 CEST 2013


I tried this on ubuntu as well:

test() ->
    File = "/home/ejoearm/work/bugs/share",
    {ok, X1} = file:read_file_info(File),
    {ok, X2} = file:read_link_info(File),
    {X1#file_info.type, X2#file_info.type}.

> bug:test().
{directory,symlink}

So read_file_info does follow symlinks. But the man page says it can return
type
symlink. Is this a bug in the manual page? Or have I misunderstood
something.

/Joe





On Mon, Apr 15, 2013 at 11:51 AM, Jon Schneider <>wrote:

> > I believe file:read_file_info/1,2 will "follow" symlinks and give you
> > information
>
> Clearly there's a job to decide what these functions are _supposed_ to do
> exactly and fix code and documentation.
>
> Jon
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130415/6627303f/attachment.html>


More information about the erlang-questions mailing list