How to accèss parent directory in OS agnostic way

#1

In some package I do this:

const srcdir = dirname(@__FILE__)
const datadir = joinpath(srcdir, "../data/")

But I expect Windows will not like “…/”. What’s the right way to do this? I had trouble scrounging this from the docs.

0 Likes

#2

joinpath(srcdir, "..", "data")

1 Like

#3

Of course. Thanks!

0 Likes