# Is there a Gleam library to read file contents?

**URL:** <https://erlangforums.com/t/is-there-a-gleam-library-to-read-file-contents/2425>\
**Category:** Gleam Forum\
**Tags:** gleam-questions, files\
**Created:** [March 2, 2023, 7:18pm UTC](https://erlangforums.com/t/is-there-a-gleam-library-to-read-file-contents/2425 "2023-03-02T19:18:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlotm](https://erlangforums.com/user_avatar/erlangforums.com/carlotm/32/1870_2.png) [@carlotm](https://erlangforums.com/u/carlotm)\
**Post date:** [March 2, 2023, 7:18pm UTC](https://erlangforums.com/t/is-there-a-gleam-library-to-read-file-contents/2425/1 "2023-03-02T19:18:26Z")

</div>

Hi all,

is there a library to read file contents?  
I saw [greggreg / gleam\_file · GitLab](https://gitlab.com/greggreg/gleam_file)  
but it does not work with the current version of stdlib

```erlang
> gleam add gleam_file
  Resolving versions
error: Dependency resolution failed

An error occurred while determining what dependency packages and versions
should be downloaded.
The error from the version resolver library was:

Because gleam_file depends on gleam_stdlib 0.11.0 and lss 0.0.0 depends on
gleam_stdlib 0.27.0, gleam_file ∗, lss 0.0.0 are incompatible.
And because lss 0.0.0 depends on gleam_file, lss 0.0.0 is forbidden.

```

Is there any other library I can use?

Thanks

---

<div class="post-metadata">

**Author:** ![lpil](https://erlangforums.com/user_avatar/erlangforums.com/lpil/32/222_2.png) [@lpil](https://erlangforums.com/u/lpil)\
**Post date:** [March 2, 2023, 8:18pm UTC](https://erlangforums.com/t/is-there-a-gleam-library-to-read-file-contents/2425/2 "2023-03-02T20:18:36Z")

</div>

Hello! Check out the [file module](https://hexdocs.pm/gleam_erlang/gleam/erlang/file.html) in the official `gleam_erlang` package.

It’s unfortunate that there is a dead package with the name `gleam_file`, it causes a lot of confusion. It’s recommended that only packages maintained by the core team have the `gleam_` prefix for this reason.

---

<div class="post-metadata">

**Author:** ![carlotm](https://erlangforums.com/user_avatar/erlangforums.com/carlotm/32/1870_2.png) [@carlotm](https://erlangforums.com/u/carlotm)\
**Post date:** [March 3, 2023, 5:55am UTC](https://erlangforums.com/t/is-there-a-gleam-library-to-read-file-contents/2425/3 "2023-03-03T05:55:37Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![tankorsmash](https://erlangforums.com/user_avatar/erlangforums.com/tankorsmash/32/2290_2.png) [@tankorsmash](https://erlangforums.com/u/tankorsmash)\
**Post date:** [March 11, 2024, 6:04pm UTC](https://erlangforums.com/t/is-there-a-gleam-library-to-read-file-contents/2425/4 "2024-03-11T18:04:08Z")

</div>

I think the file system stuff got removed in v0.24 I think (looks like it based on this commit, [Changes! · gleam-lang/erlang@0ad27f2 · GitHub](https://github.com/gleam-lang/erlang/commit/0ad27f2d4bbbcb765b3f62a6b1e20c14596ebc66) ( the [CHANGELOG.md](https://github.com/gleam-lang/gleam/blob/main/CHANGELOG.md#0240---2022-10-25) links the [blog post](https://gleam.run/news/gleam-v0.24-released/), but the blog post says look at CHANGELOG.md for details

[GitHub - bcpeinhardt/simplifile: Simple file operations for Gleam that work on all targets (Erlang/Node/Deno)](https://github.com/bcpeinhardt/simplifile/) Simplifile seems like a dropin replacement, but not sure
