Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you can't run a process when the change occurs, then there's not much you can do except scan the filesystem, and check the modification date/time. This requires you to store each file's last date/time, though, and compare.</p> <p>You can speed this up by using the <a href="http://en.wikipedia.org/wiki/Archive_bit" rel="nofollow noreferrer">archive bit</a> (though it may mess up your backup software, so proceed carefully).</p> <blockquote> <p>An archive bit is a file attribute present in many computer file systems, notably FAT, FAT32, and NTFS. The purpose of an archive bit is to track incremental changes to files for the purpose of backup, also called archiving.</p> <p>As the archive bit is a binary bit, it is either 1 or 0, or in this case more frequently called set (1) and clear (0). The operating system sets the archive bit any time a file is created, moved, renamed, or otherwise modified in any way. The archive bit therefore represents one of two states: "changed" and "not changed" since the last backup.</p> <p>Archive bits are not affected by simply reading a file. When a file is copied, the original file's archive bit is unaffected, however the copy's archive bit will be set at the time the copy is made.</p> </blockquote> <p>So the process would be:</p> <ol> <li>Clear the archive bit on all the files</li> <li>Let the file system change over time</li> <li>Scan all the files - any with the archive bit set have changed</li> </ol> <p>This will eliminate the need for your program to keep state, and since you're only going over the directory entries (where the bit is stored) and they are clustered, it should be very, very fast.</p> <p>If you can run a process during the changes, however, then you'll want to look at the <a href="http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(VS.80).aspx" rel="nofollow noreferrer">FileSystemWatcher</a> class. Here's an <a href="http://msdn.microsoft.com/en-us/library/chzww271(VS.80).aspx" rel="nofollow noreferrer">example</a> of how you might use it.</p> <p>It also exists in <a href="https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6165137.html" rel="nofollow noreferrer">.NET</a> (for future searchers of this type of problem)</p> <p>Perhaps you can leave a process running on the machine watching for changes and creating a file for you to read later.</p> <p>-Adam</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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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