Skip to content
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

Inconsistencies in events between operating systems #11

Open
rvanheest opened this issue Nov 15, 2016 · 1 comment
Open

Inconsistencies in events between operating systems #11

rvanheest opened this issue Nov 15, 2016 · 1 comment

Comments

@rvanheest
Copy link

Hi, we're looking at this library to see whether it will be useful in one of our projects. A first question is whether this library is still maintained and whether people are using it, especially given that it is not that active in commits...

Since this repo does not have much documentation, we're left to figuring out how the API works and what it all does by looking at the code, unit test (single) and just experimenting (which is actually the way I prefer to do things). We're looking at a couple of scenario's right now that sparked some curiosity and raised some questions. These mainly have to do with the events that are being produces by the Observable and their differences between Mac and Windows systems.

(You can find the code for the file system monitor here)

Scenario 1: If a file exists on startup and gets changed after startup
On Mac we get a CREATE event for both the folder and the file (both with absolute path), followed by a DELETE of the file with a relative path, even though it still exists
On Windows we get only a MODIFY event, however, it contains an invalid path: if we watch the directory <project-base-dir>/target/test/FileUtils/ containing a file hello.txt, the path we get is <project-base-dir>/hello.txt. This happens in all following scenarios on Windows as well!

Scenario 2: Scenario 1 followed by another change
On Mac will add a MODIFY event for both the folder and file
On Windows will add a MODIFY event for only the file

Scenario 3: Deleting a file
On Mac will cause a MODIFY on the folder and a DELETE on the file (the latter with a relative path)
On Windows will cause a DELETE on the file alone

Scenario 4: Copy pasting a large file (3,28GB) into the monitored folder
On Mac gives a CREATE on both folder and file, immediately followed by a MODIFY on the file
On Windows gives a CREATE on the file alone, immediately followed by a MODIFY on the file and another MODIFY on the file as soon as the copy-paste has finished

Scenario 5: (only tested on Windows) writing in a file and saving it
On Windows gives inconsistently one or two MODIFY events on the file

Are we missing something here, or are these real bugs. If so, are these already known (can't find any issues on that in this repository) and are they related to either this library or the underlying java.nio.* package?

Curious to see if there are any projects that use this library and how they deal with these scenarios!

@stevegury
Copy link
Member

Hi @rvanheest,

Indeed, this project is not maintained anymore.
The library has been tested on macOS and Linux but never on Windows, it's possible that you find windows related bugs.

One closed-source project was relying on this library to react on modification of a memory mapped file, and as far as I know, everything was working just fine.

The code base is relatively small, and if you want you can make it your own (I can give you access to the repo, if you're interested).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants