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
Modify PollWatcher to support pseudo filesystems like sysfs/procfs #396
Merged
Commits on Apr 28, 2022
-
Modify PollWatcher to support pseudo filesystems like sysfs/procfs
Technically this means that you can now construct an instance of PollWatcher that performs full file contents hashing to augment the mtime comparison. This works well for pseudo filesystems that often don't adhere to durable filesystem metadata norms like accurate file sizes, modification times, etc. Closes notify-rs#391
Configuration menu - View commit details
-
Copy full SHA for a8ea074 - Browse repository at this point
Copy the full SHA a8ea074View commit details -
Configuration menu - View commit details
-
Copy full SHA for bce48ad - Browse repository at this point
Copy the full SHA bce48adView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c37969 - Browse repository at this point
Copy the full SHA 0c37969View commit details -
Configuration menu - View commit details
-
Copy full SHA for b24537c - Browse repository at this point
Copy the full SHA b24537cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 655fce5 - Browse repository at this point
Copy the full SHA 655fce5View commit details -
Configuration menu - View commit details
-
Copy full SHA for df30349 - Browse repository at this point
Copy the full SHA df30349View commit details -
Add example of new PollWatcher compare_contents feature
The example shows how to use this to effectively watch pseudo filesystems like those through sysfs (i.e. /sys/). The example by default will only work on Linux but does demonstrate well that it works where the previous metadata only approach would not. Sample output: Trying "/sys/class/net/lo/statistics/tx_bytes", use `ping localhost` to see changes! watching ["/sys/class/net/lo/statistics/tx_bytes"]... changed: Event { kind: Modify(Data(Any)), paths: ["/sys/class/net/lo/statistics/tx_bytes"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None } changed: Event { kind: Modify(Data(Any)), paths: ["/sys/class/net/lo/statistics/tx_bytes"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None } changed: Event { kind: Modify(Data(Any)), paths: ["/sys/class/net/lo/statistics/tx_bytes"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None } changed: Event { kind: Modify(Data(Any)), paths: ["/sys/class/net/lo/statistics/tx_bytes"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }
Configuration menu - View commit details
-
Copy full SHA for 1d50806 - Browse repository at this point
Copy the full SHA 1d50806View commit details -
Configuration menu - View commit details
-
Copy full SHA for d42ec0e - Browse repository at this point
Copy the full SHA d42ec0eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d12611c - Browse repository at this point
Copy the full SHA d12611cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 09122bf - Browse repository at this point
Copy the full SHA 09122bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a65496 - Browse repository at this point
Copy the full SHA 8a65496View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e2b9ab - Browse repository at this point
Copy the full SHA 6e2b9abView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a53306 - Browse repository at this point
Copy the full SHA 5a53306View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.