[erlang-questions] symlink error (I think)

Jeff Schultz jeffschultz@REDACTED
Mon Apr 15 15:19:05 CEST 2013


On 15/04/2013 20:28, Joe Armstrong wrote:
> 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.

Just a guess, but it may return symlink if the symlink's target doesn't 
exist, and the target's type otherwise.

If so, that's probably worth pointing out in the documentation.


     Jeff Schultz





More information about the erlang-questions mailing list