[Csnd] WASM fs oddities

I have observed a couple of strange behaviours in the fs functions of the latest WASM build (https://www.npmjs.com/package/@csound/browser) - assuming I’m using them right - does anyone know about these or have any suggestions on how to work around?

Basically it seems like files can’t be unlinked, and creating a file in an attempt to overwrite it results in a duplicate, with the same name. Incidentally file appending works ok, so it seems existing data may not be modified:

// appearance of duplicate files when writing same path
for (var x = 0; x < 6; x++) csound.fs.writeFile("/test", new Uint8Array([99 + x]));
console.log(await csound.fs.readdir("/"));
// ["test", "test", "test", "test", "test", "test"]

// unlink doesn't appear to work
let file = "/deleteme";
csound.fs.writeFile(file, new Uint8Array([0]));
csound.fs.unlink(file);
console.log(await csound.fs.readdir("/"));
// ["deleteme"]

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

I missed the awaits on the writeFile and unlink calls in the example - but it has the same result.

it sounds like you found a bug, the unlink is probably a rare use-case and I may have missed out a bug when developing this fs module, please open a ticket so I don’t forget about this

OK, thanks - does the ticket need to go on the main csound/csound repository or somewhere else?