Question:
Is there a way to track file progress on Linux (i.e. a new file / save the file)?
Details:
I know inotify , which can be used to track entire folders to create, delete and modify files. However, this is a very low level. When saving a file, text editors often write the modified buffer to a temporary location, then move it and overwrite the original file. It could be seen inotify like CREATEa MOVE, when I want it MODIFY.
It seems contradictory to me that every time a file is saved, it is interpreted as a new file. Is there an identification value of the file that I can use to distinguish between creating a new file and saving an existing file? Another way to ask this question is: "How do programs like Beagle , Spotlight , Windows Search and Google Desktop get around this?"
Purpose:
Here is a good way to describe what I want: using Vim, if I open the file and save it ( :w), this file will be written to a temporary file and then transferred to the original file, cheating inotify, believing that a completely new file was created, and then used to overwrite the original file. However, if you add the file to subversion ( svn), then open this file with Vimand save it ( :w), it svnwill know that the saved file is actually a modified file, not a new one. How to know svn?
source
share