# Unable to read or cd into volume mounted for app

**URL:** <https://community.fly.io/t/unable-to-read-or-cd-into-volume-mounted-for-app/13218>\
**Category:** General\
**Tags:** elixir, login-only\
**Created:** [May 31, 2023, 12:35am UTC](https://community.fly.io/t/unable-to-read-or-cd-into-volume-mounted-for-app/13218 "2023-05-31T00:35:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ananda099](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/ananda099/32/16059_2.png) [@ananda099](https://community.fly.io/u/ananda099)\
**Post date:** [May 31, 2023, 12:35am UTC](https://community.fly.io/t/unable-to-read-or-cd-into-volume-mounted-for-app/13218/1 "2023-05-31T00:35:42Z")

</div>

I have a phoenix 1.7 app running on [fly.io](http://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 ?

---

<div class="post-metadata">

**Author:** ![ananda099](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/ananda099/32/16059_2.png) [@ananda099](https://community.fly.io/u/ananda099)\
**Post date:** [May 31, 2023, 12:41am UTC](https://community.fly.io/t/unable-to-read-or-cd-into-volume-mounted-for-app/13218/2 "2023-05-31T00:41:31Z")

</div>

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

```auto
File.cd("/data")
File.ls()

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [June 7, 2023, 12:42am UTC](https://community.fly.io/t/unable-to-read-or-cd-into-volume-mounted-for-app/13218/3 "2023-06-07T00:42:00Z")

</div>

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