[erlang-questions] symlink error (I think)

Joe Armstrong <>
Sun Apr 14 17:28:30 CEST 2013


I have a troublesome symlink that puts one of my programs into a loop

If I list the files in my troublesome directory I see this:

ls -l /Users/joe/projects/fuse/fuserl-2.0.5/fw
total 8
drwxr-xr-x@  6 joe  staff  204 Jul 23  2009 bin
drwxr-xr-x@  3 joe  staff  102 Jul 23  2009 build
drwxr-xr-x@ 19 joe  staff  646 Jul 23  2009 m4
drwxr-xr-x@  4 joe  staff  136 Jul 23  2009 package
drwxr-xr-x@  5 joe  staff  170 Jul 23  2009 revision
drwxr-xr-x@  9 joe  staff  306 Jul 23  2009 sh
lrwxr-xr-x   1 joe  staff    2 Oct 16  2011 share -> ..
drwxr-xr-x@  7 joe  staff  238 Jul 23  2009 template

So share is a link to '..'

But file:read_file_info thinks 'share' is a directory


-module(bug).
-compile(export_all).

-include_lib("kernel/include/file.hrl").

test() ->
    {ok, X} =
file:read_file_info("/Users/joe/projects/fuse/fuserl-2.0.5/fw/share"),
    X#file_info.type.

Running this

> bug:test()
directory.

I'd expected this to return symlink

This is on a macbook OS X 10.8.3

Is this a bug, or have I misunderstood something

Cheers

/Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130414/21f7c515/attachment.html>


More information about the erlang-questions mailing list