linux - Python Watch Folder - interrogating list for filesize -


I am trying to get the following code to see a folder for the change and the file name (primarily A complete path) Returning as a string Once it was checked that the filesystem has not been recently increased, to prevent the rest of my script to inspect the incomplete files, I need to set my filesystem timer function name Send in Inai'm getting because I collect the search went files as a List I if I'm barking up the wrong tree, I do not hesitate to tell you, and thanks for any help!

Stewart

  import os, time def watch (path_to_watch): first for Oslistdir (path_to_watch)] for f = dict (f ([(f, none) ) Whereas clock_activ == 1: time.sleep (10) = after dict ([(F, none) f (path_to_watch) in oslistdir]] = added [f after f for f if not f =] If not added to f after f for f] if added: filesizechecker (added) back if removed: print "deleted:", "after def filesizechecker (filepath) =" before "(extracted). Checks files and # returns 1 when file 3 seconds If you do not change it, then FalLocon = Open (FilePath, "RB") fthen = 1 fern      

Div class = "post-text" itemprop = "text">

You can also see how lsof works, it lists open files if you The file you are viewing (or if) is not open, it is also not possible that it is being changed.

You are on Linux so that you can always view the / proc filesystem for information processes and files .

I do not know the details, so it arises that you think this time is worth you :)


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -