#Path.expand doesn't return the absolute path on an Elixir release

8 messages · Page 1 of 1 (latest)

proper stratus
#

Hi! I'm running into a weird problem where Path.expand doesn't return the absolute path while running an elixir release. We're passing as argument this kind of path path = ../../../../examples/simple/simple_scripts/script_1
And doing
Path.expand(path) returns
examples/simple/simple_scripts/script_1 instead of
home/project/examples/simple/simple_scripts/script_1
Does anyone know why?.

spice hearth
#

I think because there is bug in the docs, as it will not make your path absolute

tacit citrus
#

Deep down :file.get_cwd() is called, so perhaps that is returning an error? It could if there are permission problems somewhere in the directory hierarchy.

#

I would suggest adding some debug code that logs the return of that, or File.cwd() which also calls :file.get_cwd().

proper stratus
#

It is really weird, File.cwd returns the right directory

#

We were using distillery to create releases and now that we switched to elixir releases we encountered this problem

tacit citrus
#

Maybe CWD is different now, and so the expansions are slightly different. I don't know, I never did distillery.

#

I would recheck assumptions