-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fall through .watch()
and /watchFile()
#89
Comments
What are the options?
What is the best behavior? |
The best I could come up with was having a watch manager in union fs that when That would mean that you would be able handle things like:
An interesting case would be what happens when a folder is created on a filesystem above a filesystem that already has that folder - do you then union that folder as well - do a I would think this functionality could be helpful in testing. I am not currently using it though, so it could just be a won't fix for now. FYI I am just using ufs, memfs and monkey-patch at the moment. Testing a file parser and a file watcher on files that are on memfs. |
I’ve fixed this in 4.0.0 where you watch all available file systems for changes. |
@LukeSheard is this closed then? |
I'm getting weird behavior: const ufs = new Union()
const infs = ufs
// @ts-expect-error
.use(this.memoryFS)
.use({ ...fs })
patchFs(ufs)
console.log(ufs.watch('').on) It logs |
Possibly related to streamich/memfs#116
Not sure if this is a bug or a feature request. Currently, (at least)
fs.watch()
calls do not fall through to the other file systems that are joint in the unionfs. Was going to say it would be good if on detection of a ENOENT error on the first file system, if unionfs tried the other filesystems in the union for the file, but that will cause issues when you then create the folder/file on the top unionfs file system.The text was updated successfully, but these errors were encountered: