Feels like the addition of os.Root to stdlib somewhat standardized what a writable FS looks like. Personally, I think Append() would be a bit too high level for a *filesystem* interface, and that something more like FUSE would make more sense. Maybe with some Capabilities() method to signal what functionality you actually implement. It does get a bit too muddy the more I think about it though. Thanks, Ian. That was an interesting thread -- yes, complicated! However, it seems that at least Create() was suggested several times with the same basic shape, so I guess I'm aiming in the right direction. My Append() seems to be novel, but I think "fits". It avoids the interface having to think about OS-level mode/perm/flags. On Mon, Jul 27, 2026 at 8:15 PM [email protected] <[email protected]> wrote:
>
> I'd like it to be shaped like io/fs.FS. However, that only supports read-only files (Open returns an fs.File). So my thought is to have an interface extension like so:
>
> type WriteFS interface {
> fs.FS
> Create(name string) (io.WriteCloser, error)
> Append(name string) (io.WriteCloser, error)
> }
There is some previous discussion at https://go.dev/issue/45757.
TL;DR: It's complicated.
Ian
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/CAL9jXCH3%3DREus%3DYZeO53zuMsTekdstX5MKCrva_eK7nWnemA7g%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/CADgY6e9A1_%2BfyEvV%2BStwRU%2B7fUpH%3D6ZvY87RGHkHL8%2BmKrT_2w%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/341DCE0E-7F49-44DF-98A0-CA0643C0536A%40attahri.com.
|
smime.p7s
Description: S/MIME cryptographic signature