Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Directory checksum with python?

So I'm in the middle of web-based filesystem abstraction layer development. Just like file browser, except it has some extra features like freaky permissions etc.

I would like users to be notified somehow about directory changes. So, i.e. when someone uploads a new file via FTP, certain users should get a proper message. It is not required for the message to be extra detailed, I don't really need to show the exact resource changed. The parent directory name should be enough.

What approach would you recommend?

like image 772
ohnoes Avatar asked Jan 31 '26 08:01

ohnoes


2 Answers

If your server is Linux you can do this with something like inotify

If the only updates are coming from FTP, then another solution I've used in the past is to write an add-on module to ProFTPD that performs the "notification" once upload is complete.

like image 116
Van Gale Avatar answered Feb 02 '26 20:02

Van Gale


See this question: How to quickly find added / removed files?

But if you can control the upload somehow (i.e. use HTTP POST instead of FTP), you could simply send a notification after the upload has completed. This has the additional benefit that it would be simple to make sure users never see a partial file.

like image 21
Aaron Digulla Avatar answered Feb 02 '26 21:02

Aaron Digulla