[erlang-questions] windows paths in filename module

Tim Watson <>
Fri Nov 25 15:01:38 CET 2011


>
> > Am I doing something wrong?
>
> I think the trouble is here:
>
> join(Name1, Name2) when is_list(Name1), is_list(Name2) ->
>    OsType = major_os_type(),
>    case pathtype(Name2) of
>        relative -> join1(Name1, Name2, [], OsType);
>        _Other -> join1(Name2, [], [], OsType)
>    end;
>
> because "\\Users\\602382443" is getting a pathtype of 'volumerelative'
> and should be treated just like 'relative' when Name1 is a drive
> reference. If it's not, then I'm not sure what is the right
> interpretation.
>
Yes I can see why the code does that. This seems rather unintuitive on
windows. For now I'll stick to handling it explicitly, but it would be
*nice* if the behaviour was unsurprising.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111125/38121cc2/attachment.html>


More information about the erlang-questions mailing list