Is there a Gleam library to read file contents?

Hi all,

is there a library to read file contents?
I saw greggreg / gleam_file · GitLab
but it does not work with the current version of stdlib

> 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

2 Likes

Hello! Check out the file module 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.

2 Likes

Thank you!

2 Likes

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 ( the CHANGELOG.md links the blog post, 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) Simplifile seems like a dropin replacement, but not sure