[erlang-questions] windows paths in filename module

Tim Watson watson.timothy@REDACTED
Fri Nov 25 15:30:22 CET 2011


Problem solved. Thanks Daniel, that's exactly what I'm looking for!!!

On 25 November 2011 14:01, Daniel Goertzen <daniel.goertzen@REDACTED>wrote:

> If you're just looking for your home dir, try this:
>
>
> 1> init:get_argument(home).
> {ok,[["C:\\Users\\goertzen"]]}
>
>
> Dan.
>
>  On Fri, Nov 25, 2011 at 7:38 AM, Tim Watson <watson.timothy@REDACTED>wrote:
>
>>  What the heck is this all about???
>>
>> 40>
>> os:getenv("HOMEDRIVE").
>>
>> "C:"
>> 41>
>> os:getenv("HOMEPATH").
>>
>> "\\Users\\602382443"
>> 42> filename:join(os:getenv("HOMEDRIVE"),
>> os:getenv("HOMEPATH")).
>> "/Users/602382443"
>> 43> filename:nativename(filename:join(os:getenv("HOMEDRIVE"),
>> os:getenv("HOMEPATH"))).
>> "\\Users\\602382443"
>> 44> filename:nativename("C:/" ++
>> os:getenv("HOMEPATH")).
>> "c:\\Users\\602382443"
>> 45> "C:" ++ os:getenv("HOMEPATH").
>> "c:\\Users\\602382443"
>> Do I *really* have to do this by hand? I had assumed that the whole point
>> of filename:join/2 was that it does the right thing on each platform
>> without me having to worry about what the directory separator is meant to
>> be?
>>
>> Am I doing something wrong?
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111125/8635f1f4/attachment.htm>


More information about the erlang-questions mailing list