You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an interesting use case where I have some functions that run over a billy.Filesystem and I want to run them on a directory while ignoring a specific file. Ideally, I'd be able to do this without modifying the functions and without modifying the underlying filesystem. Instead, I want to construct a memfs from an osfs, and then delete the ignored file from the memfs so I can run the function on the memfs without needing to modify this.
Is this functionality difficult to implement? I couldn't find documentation on the best way to do this.
The text was updated successfully, but these errors were encountered:
Implement an utility function that copies a directory recursively from one file system to another.
Implement a copy-on-write filesystem that wraps two underlying filesystems. A read-only layer (osfs in your case) and a writeable layer (memfs in your case). This would allow you to access osfs without copying it to memfs. This also works for cases where you modify files, not just delete. Afero has an implementation of this that can guide you on the implementation.
Implement something like a masking fs wrapper. That is, a filesystem that is constructed with an underlying filesystem, include glob expressions and exclude glob expressions. With this, you could wrap your osfs with it, excluding the file you don't want.
None of these are currently implemented in go-billy. I guess these might be accepted for the helper or util subpackages, but that's something to be discussed with @mcuadros.
Implement something like a masking fs wrapper. That is, a filesystem that is constructed with an underlying filesystem, include glob expressions and exclude glob expressions. With this, you could wrap your osfs with it, excluding the file you don't want.
"exclude glob expressions" part sounds like a commonly used pattern, kinda like .gitignore. I'm willing to try implementing this.
I have an interesting use case where I have some functions that run over a
billy.Filesystem
and I want to run them on a directory while ignoring a specific file. Ideally, I'd be able to do this without modifying the functions and without modifying the underlying filesystem. Instead, I want to construct amemfs
from anosfs
, and then delete the ignored file from thememfs
so I can run the function on thememfs
without needing to modify this.Is this functionality difficult to implement? I couldn't find documentation on the best way to do this.
The text was updated successfully, but these errors were encountered: