# Appending trailing slashes to paths

**URL:** <https://discourse.julialang.org/t/appending-trailing-slashes-to-paths/15922>\
**Category:** Internals & Design\
**Created:** [October 5, 2018, 11:50am UTC](https://discourse.julialang.org/t/appending-trailing-slashes-to-paths/15922 "2018-10-05T11:50:09Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [October 8, 2018, 12:56am UTC](https://discourse.julialang.org/t/appending-trailing-slashes-to-paths/15922/21 "2018-10-08T00:56:31Z")

</div>

I was rather talking about the implementation, not the API. For example,

> `os.path.abspath()` simplifies “…” path components without resolving symlinks first

– [PEP 428 – The pathlib module – object-oriented filesystem paths | peps.python.org](https://www.python.org/dev/peps/pep-0428/#sane-behaviour)

But if you don’t look at `os.path` _implementation_ (or emulation is perfect such that Julia copied the bug) I guess there is no problem.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [October 8, 2018, 12:58am UTC](https://discourse.julialang.org/t/appending-trailing-slashes-to-paths/15922/22 "2018-10-08T00:58:10Z")

</div>

I’m not sure I agree that not resolving symlinks is broken. There’s not exactly a lot of analysis of why that’s wrong, mostly just an assertion.

---

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [October 8, 2018, 1:32am UTC](https://discourse.julialang.org/t/appending-trailing-slashes-to-paths/15922/23 "2018-10-08T01:32:09Z")

</div>

Because otherwise you’d get something different from `read(path)` and `read(abspath(path))`?

```nohighlight
$ mkdir -p c/d
$ ln -s c/d a
$ echo "./b" > b
$ echo "./c/b" > c/b
$ cat a/../b
./c/b
$ julia -e 'write(stdout, read("a/../b"), read(abspath("a/../b")), read(realpath("a/../b")))'
./c/b
./b
./c/b

```

---

<div class="post-metadata">

**Author:** ![flywire](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/flywire/32/31144_2.png) [@flywire](https://discourse.julialang.org/u/flywire)\
**Post date:** [November 26, 2021, 9:46pm UTC](https://discourse.julialang.org/t/appending-trailing-slashes-to-paths/15922/24 "2021-11-26T21:46:40Z")

</div>

> [@mauro3](#):
>
> You should use `joinpath` though.

Please show example using `pathlib.Path.home()`

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 28, 2021, 2:07am UTC](https://discourse.julialang.org/t/appending-trailing-slashes-to-paths/15922/25 "2021-11-28T02:07:08Z")

</div>

You may be posting in the wrong forum. This is Julia.

[Previous page](https://discourse.julialang.org/t/appending-trailing-slashes-to-paths/15922.md?page=1)
