spf13 / afero

A FileSystem Abstraction System for Go
Apache License 2.0
5.79k stars 498 forks source link

[QUESTION] Convert embed.FS to afero.MemMapFS #383

Open dzonerzy opened 1 year ago

dzonerzy commented 1 year ago

As the title says is it possible to convert and embed.FS to a MemMapFS? This way I can make the memory FS writable too.

I want to use that FS within fiber, this FS will contains html templates, so a wanna have a set of predefined/default templates defined as (embed.FS) but I also want to be able to add more templates at runtime, thus the request to convert embed.FS to MemMapFS

bep commented 1 year ago

As the title says is it possible to convert and embed.FS to a MemMapFS?

That's not possible. There is an adapter that allows yo to create a fs.Fs from a MemMapFS, but there will be no write operations.