Note that there are some explanatory texts on larger screens.

plurals
  1. POWatching a file for changes in Linux
    primarykey
    data
    text
    <h1>Question:</h1> <p>Is there any way to track the progress of a file in Linux (ie. new file/save file)?</p> <h1>Details:</h1> <p>I am aware of <a href="http://en.wikipedia.org/wiki/Inotify" rel="nofollow">inotify</a> which can be used to track entire folders for file creation, deletion, and modification. However, those are very low level. Text editors often when saving a file, write the modified buffer a temporary location, then move it and overwrite the original file. This would be seen by inotify as a <code>CREATE</code> and a <code>MOVE</code> when what I want is a <code>MODIFY</code>.</p> <p>It seems counter intuitive to me that every time a file is saved it would be interpreted as a new file. Is there any identifying value of a file I can use to distinguish between creating a fresh new file and saving an existing file? Another way to ask this question is: "How do programs such as <a href="http://en.wikipedia.org/wiki/Beagle_%28software%29" rel="nofollow">Beagle</a>, <a href="http://en.wikipedia.org/wiki/Spotlight_%28software%29" rel="nofollow">Spotlight</a>, <a href="http://en.wikipedia.org/wiki/Windows_Search" rel="nofollow">Windows Search</a>, and <a href="http://en.wikipedia.org/wiki/Google_Desktop" rel="nofollow">Google Desktop</a> get around this problem"?</p> <h1>Goal:</h1> <p>Here is a good way to describe what I want: Using <code>Vim</code>, if I open a file and save it (<code>:w</code>), that file will get written to a temporary file and then moved over to the original file, tricking <code>inotify</code> into believing that a completely new file was created and then used to overwrite the original file. However, if add a file to subversion (<code>svn</code>), then open that file with <code>Vim</code> and save it (<code>:w</code>), <code>svn</code> will know that the saved file is actually a modified file and not a new one. How does <code>svn</code> know this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload