slawlor / ractor_actors

Common utility actors built with Ractor
MIT License
13 stars 2 forks source link

File Watcher not working on Mac OS (`.db` file) #17

Open bichsonnhat opened 7 months ago

bichsonnhat commented 7 months ago

I am trying to edit a file .db (sqlite file) through insert, update, delete operations, but it seems not to be working on MacOS. I have tried editing .txt, .rs files, and they all work, but not .db files.

https://github.com/bichsonnhat/ractor_actors/blob/main/ractor_actors/src/filewatcher/tests.rs#L9C1-L23C6

It still works well on Windows, so is this an issue arising from the operating system or some other reason related to the file type that FileWatcher supports on MacOS?

Thank you.

slawlor commented 7 months ago

Hmm this is strange. The only think I could think of is is your sqlite library writing to a hidden shadow file while the process is open? I know that can sometimes be common (I'm not familiar enough with the sqlite variety of libraries to be sure)

slawlor commented 7 months ago

https://github.com/bichsonnhat/ractor_actors/blob/main/ractor_actors/src/filewatcher/tests.rs#L9C1-L23C6

Also what is this test supposed to determine?

bichsonnhat commented 7 months ago

https://github.com/bichsonnhat/ractor_actors/blob/main/ractor_actors/src/filewatcher/tests.rs#L9C1-L23C6

Also what is this test supposed to determine?

I am building my project on all platforms, and I am encountering issues with the .db file on MacOS, even though it worked fine when tested on Windows.

bichsonnhat commented 7 months ago

Hmm this is strange. The only think I could think of is is your sqlite library writing to a hidden shadow file while the process is open? I know that can sometimes be common (I'm not familiar enough with the sqlite variety of libraries to be sure)

Can you execute FileWatcher on a database file? Specifically on MacOS.

slawlor commented 7 months ago

I can see if I can report but I don't have the ability to test all platforms. If you could give an example that reproduces the problem it'd be good.

Additionally have you checked the upstream docs on the dependent file watching crate?