# Can I write to the file system?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-i-write-to-the-file-system%2F155246%3E%5C
**Category:** Spaces\
**Created:** [May 14, 2025, 9:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-i-write-to-the-file-system%2F155246 "2025-05-14T21:45:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PabloVD](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pablovd/32/34178_2.png) [@PabloVD](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FPabloVD)%5C
**Post date:** [May 14, 2025, 9:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-i-write-to-the-file-system%2F155246%2F1 "2025-05-14T21:45:09Z")

</div>

I have an app where I need to write files to the file system, like:

```auto
os.makedirs(work_dir)

```

Is that possible? I tried with a docker image but I got a `PermissionError: [Errno 13] Permission denied` in that line. Any way to overcome that?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [May 15, 2025, 2:30am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-i-write-to-the-file-system%2F155246%2F2 "2025-05-15T02:30:47Z")

</div>

I think you can basically access the directory under `/home/user/` (or possibly `/home/` ?) using that method. There is no way to access a path higher up…

(This also causes an error in `Dockerfile`’s `WORKDIR`, etc.)

> [@Error code 137 - cache error](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-code-137-cache-error%2F152177)%3A
>
> build error Job failed with exit code: 137 the docker image is FROM [ghcr.io/open-webui/open-webui:latest](http://ghcr.io/open-webui/open-webui:latest). my cpu is of Upgrade, persistent storage = small. This was working perfectly and stopped i think since 10 days ago

---

<div class="post-metadata">

**Author:** ![PabloVD](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pablovd/32/34178_2.png) [@PabloVD](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FPabloVD)%5C
**Post date:** [May 16, 2025, 8:36am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-i-write-to-the-file-system%2F155246%2F3 "2025-05-16T08:36:31Z")

</div>

That was the reason! I needed to create an user and work in the user folder. The steps to follow are explained [here](https://huggingface.co/docs/hub/spaces-sdks-docker).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsystem)%5C
**Post date:** [May 16, 2025, 8:36pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-i-write-to-the-file-system%2F155246%2F4 "2025-05-16T20:36:50Z")

</div>

Closed on May 16, 2025, 8:36pm UTC

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