djdv / go-filesystem-utils

ISC License
10 stars 2 forks source link

cgofuse refactoring #26

Closed djdv closed 1 year ago

djdv commented 2 years ago

These are the various changes made to the bridge between Go's fs.FS and the cgofuse interfaces (which itself targets FUSE, WinFSP, fusefs, PUFFS, et al.).

As-is, works well enough for some read-only filesystems. Various modifying operations not fully considered, like metadata changes, file creation, writes, etc. These need to be added later; likely with interfaces to match within the filesystem pkg (our extensions to Go's fs.FS).

We don't have to be perfect with these changes, just improve on what was there before. Further PRs can come later if they're not immediately important or relevant to this set. For example, methods that are not yet implemented can be implemented in future PRs, unless they're really needed right now.


PR meta: Adds on top of https://github.com/djdv/go-filesystem-utils/pull/25 originally derived from https://github.com/djdv/go-filesystem-utils/pull/20 Initially targeting the j/filesystem-interfaces, which should target staging/refactor after that's merged.

Because I did the foolish thing of moving source files around, this might be (slightly) easier to read with git diff -M1% j/filesystem-interfaces. Or just commit-by-commit in reverse order. One day I might have good commit habits instead of big bulk batches, but not today. (;´∀`)

djdv commented 2 years ago

https://github.com/djdv/go-filesystem-utils/pull/26/commits/fa0f090e17ca35bbadd6d46938cb3eea4c151d3a

Does the compiler actually still act that way

Apparently it still does, so this is (unfortunately) still the best way to handle this. We can remove the uncertainty from the commit message when renaming these things.

djdv commented 1 year ago

During the final rebase (in the next PR), d7de6aa009d96c6de42ea0e7d70f23602c8ce50c should probably get folded into 827755d84a93c122209fc9bc909fd8532c2dd3c9 Tests would be nice too.