Skip to content

Error errno 29 when FS.write on preloaded data #20153

@soyuka

Description

@soyuka

Version: emscripten/emsdk:3.1.45

To reproduce you need to preload some data, then just call FS.writeFile('/somepreloadeddata'). You can find my compile arguments at https://github.com/soyuka/php-wasm/blob/main/Dockerfile but there's nothing fancy. It looks like the data is already open with a cursor somewhere in that file.
What works is to FS.unlink first then you're able to FS.writeFile again. I've tracked the call to the write call at (

FS.write(stream, buf, 0, actualNumBytes, undefined, opts.canOwn);
) and obviously when trying to write using fopen etc. it also fails.
I'm not sure if we can access current opened file descriptor so that we could try to close the opens one. I'm not even sure why these would be kept open as I haven't mounted anything (on start we probably mount the memfs though but why are these files kept open?).

Anyways, I'm enjoying your work a lot so thanks to everyone working on this project :).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions