Erlang/OTP Forums

Author Message

<  Erlang bugs mailing list  ~  ERL_LIBS and Windows (minor quirk)

steved
Posted: Tue Jan 05, 2010 1:23 am Reply with quote
User Joined: 29 Apr 2008 Posts: 78
On Windows, and unlike code:add_path, setting the ERL_LIBS environment
variable adds paths with a double-backslash... e.g.:

ERL_LIBS=D:\Erlang\lib;...

...results in:

"D:\\Erlang\\lib/yaws/ebin";...

Thus it is possible to add duplicate paths:

1> code:get_path().
[".","D:\\Erlang\\lib/yaws/ebin",...]
2> code:add_patha("D:/Erlang/lib/yaws/ebin").
true
3> code:get_path().
["d:/Erlang/lib/yaws",".","D:\\Erlang\\lib/yaws/ebin",...]

Since code:add_path converts "\\" to "/" you can even do:

2> code:add_patha("D:\\Erlang\\lib/yaws/ebin").
true
3> code:get_path().
["d:/Erlang/lib/yaws",".","D:\\Erlang\\lib/yaws/ebin",...]

...and get the exact same result!

Of course, the real problem here is the design of the underlying OS (in
many more ways than just this oddity), but perhaps somebody will be
inspired to tidy this one up as it may have some (if rather tiny) effect
on the performance of the code server.

/s

________________________________________________________________
erlang-bugs mailing list. See http://www.erlang.org/faq.html
erlang-bugs (at) erlang.org

Post received from mailinglist
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum