[Pas2js] ZenFS added

Michael Van Canneyt michael at freepascal.org
Tue May 21 14:42:12 CEST 2024


Hello,

I've added an import unit for the ZenFS filesystem emulation in PasJS
(packages/zenfs). There is a demo for it in demo (demo/zenfs).

More importantly, for those interested in WebAssembly, it is used to
implement a storage backend for WASI file support needed by a 
WebAssembly module. This was hitherto unimplemented.

So now, if you use pas2js to load a webassembly, you can furnish your
webassembly with a virtual filesystem in the browser. 
There is a demo for this as well (demo/wasienv/filesystem/)

You can see it at work here:

https://www.freepascal.org/~michael/pas2js-demos/wasienv/filesystem/

and here:

https://www.freepascal.org/~michael/fresnel/basic/

(The webassembly code displays an image. It loads the image from a PNG file...)

I plan to use the same backend to make the file routines in the units SysUtils, Classes and
IOUtils for pas2js functional.

Enjoy,

Michael.


More information about the Pas2js mailing list