Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readfile not working on Linux #931

Open
WolfBearGames opened this issue Feb 15, 2024 · 0 comments
Open

readfile not working on Linux #931

WolfBearGames opened this issue Feb 15, 2024 · 0 comments

Comments

@WolfBearGames
Copy link

What OS are you using (uname -a, or Windows version)?

Linux nobara-mini 6.7.0-204.fsync.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC TKG Wed Jan 17 09:24:55 UTC 2024 x86_64 GNU/Linux

What version Socket Runtime are you using?

0.5.4

What did you expect to see and what you saw instead?

    try {
      const contents = await fs.readFile(filepath, { encoding: "utf8" });
      console.log(contents);
    } catch (err) {
      console.log("catch file error")
      console.error((err as Error).message);
    }

Assuming "filepath" is a valid path to a .txt. file I would expect the content of the file being read into the "contents" variable.

Instead the catch clause is used and I see the following error in the log:

"FileHandle is not opened"

See an test app for reference:
fs test app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant