Re: [julia-users] joinpath behaviour on absolute paths

2015-02-06 Thread Stefan Karpinski
Was unaware of pathlib – will have to take a look. On Friday, February 6, 2015, wrote: > Second Stephan, although the newer Python pathlib (compared to os.path) is > the one that makes it *really* easy to do portable path handling (despite > its apparent complexity at first glance), its very imp

Re: [julia-users] joinpath behaviour on absolute paths

2015-02-06 Thread elextr
Second Stephan, although the newer Python pathlib (compared to os.path) is the one that makes it *really* easy to do portable path handling (despite its apparent complexity at first glance), its very impressive and could probably be provided in a very Julian way. Cheers Lex On Saturday, Febru

Re: [julia-users] joinpath behaviour on absolute paths

2015-02-06 Thread Stefan Karpinski
Path operations have been largely been copied from Python, which seems to really get this stuff right, so I'm reluctant to randomly start deviating from that. At least with this design if you're familiar with how Python does it – not everyone is, of course – then you know how things should work. O

Re: [julia-users] joinpath behaviour on absolute paths

2015-02-06 Thread elextr
On Saturday, February 7, 2015 at 3:25:09 AM UTC+11, Jameson wrote: > > Calling joinpath on various path segments before creating a final path > should be valid (to preserve associativity), which means that embedded > separators is a quite valid operation. > And paths are things that can be re

Re: [julia-users] joinpath behaviour on absolute paths

2015-02-06 Thread Seth
On Friday, February 6, 2015 at 8:25:09 AM UTC-8, Jameson wrote: > > Calling joinpath on various path segments before creating a final path > should be valid (to preserve associativity), which means that embedded > separators is a quite valid operation. > On Fri, Feb 6, 2015 at 11:16 AM Seth >

Re: [julia-users] joinpath behaviour on absolute paths

2015-02-06 Thread Jameson Nash
Calling joinpath on various path segments before creating a final path should be valid (to preserve associativity), which means that embedded separators is a quite valid operation. On Fri, Feb 6, 2015 at 11:16 AM Seth wrote: > The thing about joinpath is that it's typically used for cross-platfor

Re: [julia-users] joinpath behaviour on absolute paths

2015-02-06 Thread Seth
The thing about joinpath is that it's typically used for cross-platform compatibility. That is, there should be NO slashes that can be interpreted as directory separators in any component*, since some systems use a forward slash, some a backward slash, and some use other characters like colons t

Re: [julia-users] joinpath behaviour on absolute paths

2015-02-05 Thread elextr
This capability would have to be provided somewhere, since its absolutely essential to portably handle many path manipulation use-cases (eg provide an absolute path or a relative path that is relative to some base path). IMO joinpath() is as good a place as any to have the functionality. On Fr

Re: [julia-users] joinpath behaviour on absolute paths

2015-02-05 Thread Milan Bouchet-Valat
Le jeudi 05 février 2015 à 14:09 -0500, Stefan Karpinski a écrit : > I don't see how it's magical. The function joinpath(path1,path2) gives > the path of path2 relative to path1 – that's what it means. When path2 > is absolute, path1 doesn't matter to answer that question. Yeah, but one could also

Re: [julia-users] joinpath behaviour on absolute paths

2015-02-05 Thread Stefan Karpinski
I don't see how it's magical. The function joinpath(path1,path2) gives the path of path2 relative to path1 – that's what it means. When path2 is absolute, path1 doesn't matter to answer that question. On Thu, Feb 5, 2015 at 2:06 PM, Milan Bouchet-Valat wrote: > Le jeudi 05 février 2015 à 13:55 -

Re: [julia-users] joinpath behaviour on absolute paths

2015-02-05 Thread Milan Bouchet-Valat
Le jeudi 05 février 2015 à 13:55 -0500, Stefan Karpinski a écrit : > When you open the file referred to by path2, that is essentially > looking at joinpath(pwd(), path2) and this is just a generalization of > that that behavior relative to path1 instead of pwd() specifically. > This is also how Pyt

Re: [julia-users] joinpath behaviour on absolute paths

2015-02-05 Thread Stefan Karpinski
When you open the file referred to by path2, that is essentially looking at joinpath(pwd(), path2) and this is just a generalization of that that behavior relative to path1 instead of pwd() specifically. This is also how Python does it ,

[julia-users] joinpath behaviour on absolute paths

2015-02-05 Thread Davide Lasagna
I know this is documented by what is the rationale for joinpath(path1, path2) to return path2 if path2 looks like an absolute path? Cheers, Davide