<font color="#000000"><font face="arial,helvetica,sans-serif">Hi!<br><br>from the file-module:<br></font></font><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<b><span style="font-family:courier new,monospace"><font color="#000000">path_open_first([Path|Rest], Name, Mode, LastError) -></font><br><font color="#000000">    case file_name(Path) of</font><br><font color="#000000">    {error, _} = Error -></font><br>
<font color="#000000">        Error;</font><br><font color="#000000">    FilePath -></font><br><font color="#000000">        FileName = fname_join(FilePath, Name),</font><br><font color="#000000">        case open(FileName, Mode) of</font><br>
<font color="#000000">        {ok, Fd} -></font><br><font color="#000000">            {ok, Fd, FileName};</font><br><font color="#000000">        {error, enoent} -></font><br><font color="#000000">            path_open_first(Rest, Name, Mode, LastError);</font><br>
<font color="#000000">        Error -></font><br><font color="#000000">            Error</font><br><font color="#000000">        end</font><br><font color="#000000">    end;</font></span></b><br></blockquote><div><br>For some reason that I haven't deduced yet, my os seems to return enotdir instead of enoent when resolving a relative include. Compiling module with include-directives relative to the source in the shell will result in the call file:path_open([".", "path/to/src.erl"],"../../../relative/path/to/include", [read]), which fails because the second path in the list is never tried due to file:open/2 returning enotdir.<br>
<br>I have not yet figured out why I get this return value from the c-code, but shouldn't this be more permissive regardless? I feel that at in addition to enoent there should at least be support for eisdir and enotdir.<br>
<br>Regards<br>Thomas<br></div>