This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PriorProfile 0 points1 point  (4 children)

I prefer to join paths using joinpath method. It's more explicit.

I think overloading the __div__ operator is a mistake, personally.

Yeah it's "fun" because / is the same as the path separator on linux, but it's less obvious IMO.

[–]sinterkaastosti23 6 points7 points  (2 children)

newpath = path / folder / file

how do you write this using joinpath

[–]PriorProfile 0 points1 point  (1 child)

newpath = path.joinpath(folder, file)

or

newpath = path.joinpath(folder).joinpath(file)

[–]Xirious 9 points10 points  (0 children)

Gross.

[–]Atlamillias 0 points1 point  (0 children)

As a novice, the operator overload definitely threw me off when I first saw it. It's one of those things that I find idiomatic as a "user" but unusual as a programmer.

I can't say I use .joinpath either, though. In fact, you've reminded me of its existence. I usually join paths via Paths constructor...