# \[Csnd\] WASM fs oddities

**URL:** <https://forum.csound.com/t/csnd-wasm-fs-oddities/1912>\
**Category:** The Csound Mailinglist\
**Created:** [November 21, 2024, 12:23am UTC](https://forum.csound.com/t/csnd-wasm-fs-oddities/1912 "2024-11-21T00:23:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Knight](https://forum.csound.com/letter_avatar_proxy/v4/letter/r/aca169/32.png) [@Richard\_Knight](https://forum.csound.com/u/Richard_Knight)\
**Post date:** [November 21, 2024, 12:23am UTC](https://forum.csound.com/t/csnd-wasm-fs-oddities/1912/1 "2024-11-21T00:23:53Z")

</div>

I have observed a couple of strange behaviours in the fs functions of the latest WASM build ([https://www.npmjs.com/package/@csound/browser](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:

```csound
// appearance of duplicate files when writing same path

```

```csound
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"]

```

```csound
// unlink doesn't appear to work

```

```csound
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](mailto:Csound@listserv.heanet.ie) [https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND](https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND) Send bugs reports to [https://github.com/csound/csound/issues](https://github.com/csound/csound/issues) Discussions of bugs and features can be posted here

---

<div class="post-metadata">

**Author:** ![Richard\_Knight](https://forum.csound.com/letter_avatar_proxy/v4/letter/r/aca169/32.png) [@Richard\_Knight](https://forum.csound.com/u/Richard_Knight)\
**Post date:** [November 21, 2024, 12:28am UTC](https://forum.csound.com/t/csnd-wasm-fs-oddities/1912/2 "2024-11-21T00:28:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hlolli](https://forum.csound.com/user_avatar/forum.csound.com/hlolli/32/3_2.png) [@hlolli](https://forum.csound.com/u/hlolli)\
**Post date:** [November 21, 2024, 6:04am UTC](https://forum.csound.com/t/csnd-wasm-fs-oddities/1912/3 "2024-11-21T06:04:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Richard\_Knight](https://forum.csound.com/letter_avatar_proxy/v4/letter/r/aca169/32.png) [@Richard\_Knight](https://forum.csound.com/u/Richard_Knight)\
**Post date:** [November 21, 2024, 2:41pm UTC](https://forum.csound.com/t/csnd-wasm-fs-oddities/1912/4 "2024-11-21T14:41:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hlolli](https://forum.csound.com/user_avatar/forum.csound.com/hlolli/32/3_2.png) [@hlolli](https://forum.csound.com/u/hlolli)\
**Post date:** [October 4, 2026, 7:44am UTC](https://forum.csound.com/t/csnd-wasm-fs-oddities/1912/5 "2026-10-04T07:44:43Z")

</div>

for future reader, it was fixed in February of 2026 [wasm: fix unlink and filename overwrites issues by hlolli · Pull Request #2486 · csound/csound · GitHub](https://github.com/csound/csound/pull/2486)
