Unable to read or cd into volume mounted for app

I have a phoenix 1.7 app running on fly.io (just a simple fly deploy) and it has a volume /data that I added to the app.

Now I’m able to write to this volume by doing this :

File.write("/data/my_file.txt", binary)

But when I run

System.cmd("pdftotext", ~w[-raw /data/my_file.txt -])

It kept failing with :enoent

So to test if the file existed I just ran a cmd inside elixir

IO.inspect(System.cmd("cd", ["/data"]))

and it still gives the same error.

But when I fly ssh console into the app and cd into /data, I do see the file it has created.

What am I doing wrong ?

Answering my own question , saw it on the elixir forum. Had to use the File module.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.