[erlang-questions] symlink error (I think)

Wes James <>
Mon Apr 15 17:50:04 CEST 2013


I created a file zblah.txt and did ln -s zblah.txt zblahblah

this is what I get after deleting zblah.txt

1> file:read_file_info("zblahblah").
{error,enoent}
2> file:read_link_info("zblahblah").
{ok,{file_info,9,symlink,none,
               {{2013,4,15},{9,46,0}},
               {{2013,4,15},{9,45,59}},
               {{2013,4,15},{9,45,59}},
               41471,1,2053,0,5505639,1000,1000}}



wes



On Mon, Apr 15, 2013 at 7:19 AM, Jeff Schultz <>wrote:

> 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
>
>
>
> ______________________________**_________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/**listinfo/erlang-questions<http://erlang.org/mailman/listinfo/erlang-questions>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130415/d93b0892/attachment.html>


More information about the erlang-questions mailing list