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

Track file modifications #227

Closed
frank-lenormand opened this issue Apr 21, 2023 · 3 comments
Closed

Track file modifications #227

frank-lenormand opened this issue Apr 21, 2023 · 3 comments

Comments

@frank-lenormand
Copy link

Hi,

This might be redundant with #201, sorry in advance if that’s the case.

I would like to be able to run the callback upon file modifications (i.e. the contents have changed). Currently, even touch-ing a file triggers the shell command.

@samuelcolvin
Copy link
Owner

best to implement in your own code by reading the file.

@frank-lenormand
Copy link
Author

If that had top be handled by code that wraps watchfiles, I might as well implement all of #201 myself and not use watchfiles at all.

The idea is to have the tool react to events, one of which is “file has changed”.

@samuelcolvin
Copy link
Owner

I don't that makes sense, watchfiles in python is hundreds of lines of code, I know this because it was written in python.

Determining if a file's content has changed in a callback is about 5 loc.

That being said, if you really need this in Rust, I'd be happy to review a PR.

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