title: How does julia know what path separator and root directory to use?
body: <p>Functions like <code>joinpath</code> use the appropriate OS-dependent separator when joining two paths (ie <code>/</code> on Linux, <code>\\</code> on Windows, etc). How do these functions know what separator to use?</p>
  
  <p>Similarly, the root directory on Linux is <code>/</code>, but on Windows is probably <code>C:\\</code>. Is there a way to retrieve the OS-dependent root directory in Julia?</p>
  
  <p>Note, I've had a look at the <code>joinpath</code> <a href="https://github.com/JuliaLang/julia/blob/master/base/path.jl" rel="nofollow noreferrer">source on github</a>, and it appears to use an undocumented function <code>pathsep(a,b)</code> and a global variable <code>path_separator_re</code>, but I can't see how either of these work.</p>