The project root directory of a file located in PROJECT_ROOT/lib/code.jl
can be accessed with this code:
root = dirname(dirname(@__FILE__))
Using dirname()
twice seems pretty ugly. Is there a better way to do this? With Ruby, I would use this code:
root = File.expand_path('../', File.dirname(__FILE__))
Base.path_separator*relpath(@__FILE__*"/../..",Base.path_separator)
. Ugh. – Trochilus