Resets lastChangedDate of files if they have not really changed back to their original dates. Primarily used to backdate local copies of a website files to their original dates if they contain no net changes since the last upload. This saves pointless uploads and Google respidering. To install, Extract the zip download with WinZip, available from http://www.winzip.com (or similar unzip utility) into C:\ -- checking off the "user folder names" option. To run as an application, type: java.exe -jar C:\com\mindprod\untouch\untouch.jar mydirectory adjusting as necessary to account for where the jar file is. Put name of directory you want files reverted to old dates if they have not changed since the last time you ran untouch. To process entire tree use -s mydirectory You cannot untouch individual files. Use: untouch.jar [ -flag1 -flag2 ... ] dir1 dir2 ... Untouch supports the the following command line switches/flags which appear before the directories. -c or -clear = Clear history first and take current file times as the new revert-to point. start over. -f or -force = Revert files back to previous dates whether the contents have changed or not. -h or -help = Display a short summary of the Untouch command syntax. -r or -remove = Remove option to remove untouch history i.e. untouch.digest and untouch.log files. Stop monitoring these directories with untouch. When synching directories, you might delete these files on the target, copy the files, then recompute the digest with the times of the recently copied files which will match the source. -s or -sub or -subdir or -subdirs or -t or -tree = Process files in subdirectories as well. -l or -log = Create untouch.log files in each directory logging details of what was done. -q or -quiet = Suppress progress messages. PUT THE SWITCHES *BEFORE* THE DIRECTORY NAMES ON THE COMMAND LINE. Documentation on the original student project outline http://mindprod.com/projects/untouchproj.html This explains how it works and some of its uses. In A Nutshell ************* To copy files whose contents have truly changed (not just timestamps differ) from one directory to another, Untouch both the source and target directories. Then copy with /U (avoiding copying the *.digest files). DON'T COPY *.* or you will include the *.digest files. Then untouch the target. If it seems to be copying files it did not really need to, or is not copying files you think it should, untouch the source directories. Then copy without /U. Then untouch the target with the -c option, to clear and restart. All files in source and target should then have the same dates and sizes. Synching ******** If you have directory adir and directory bdir, and you copy files from adir to bdir using copy /u, you should make sure you untouch the files in adir before the copy. Otherwise the files in adir will look newer than those in b even when they are identical, and needlessly copy over. To avoid redundant copying, periodically untouch both adir and bdir. To resych two directories, vis a vis untouch, delete the untouch.digest file in adir and the untouch adir. Then copy files from adir to bdir. Then delete the untouch.digest file in bdir, and untouch bdir. The first time untouch runs it will take longer than usual since it must scan every byte in every file to compute the digest checksums. I use a conservative approach. To keep two directories in sync I do something like this: rem keep snippets directory in untouch sync with the example directory java.exe -jar untouch -q -s E:\com\mindprod\example E:\mindprod\jgloss\snippet rem /U=update /E=no error copy /U /E E:\com\mindprod\example\*.java E:\mindprod\jgloss\snippet rem untouch the target directory again java.exe -jar untouch -q -s E:\mindprod\jgloss\snippet If the two directories get out of sync, so you keep copying the same files over and over every time you do the copy /U, do a untouch -r on both target and source directories to remove untouch. Do you copy /U, then do an untouch on target and source directories to engage untouch again. The Rounding Problem ******************** Java (and by extension Untouch) only see the file timestamps accurate to the nearest millisecond. Windows keeps file timestamps accurate to 100 nanoseconds with 10,000 times as much precision as Java's 1 ms. This means if you copy a file in Java, the new file will not have the exact same timestamp as the old. This cause troubles when Java thinks two timestamps are identical, but Windows, especially COPY /U does not, because Java works with platfom-independent rounded off timestamps. This can lead to strange things like COPY /U repeatedly copying files that have almost the same timestamp, because untouch rounds them off making the source and target slightly different. You can normalise a directory like this to even millisecond timestamps to temporarily get rid of the anomalies. untouch . touch *.* untouch . In a future version of untouch, I will get untouch to round off the timestamp of any file it monitors to an even millisecond to avoid such glitches, effectively doing this normalising process automatically every time you run untouch. Why the backward green arrow icon? It represents putting the date back the way it was. If you use Take Command copy /UF instead of copy /U, it suppresses the copy if the source and target are dated within 2 seconds of each other. Normally, even a microsecond difference is enough to trigger the copy. This is the easiest way around the rounding problem. TIP *** You might consider using untouch ONLY just before you upload files. That way if you change a file and change it back to the way it was, or delete it and recreate it the same way, it will get outouched back to the original date, and thus will not need to be uploaded. If you do intermediate untouches, you won't exploit that opportunity. LEGEND ****** The legend displayed both tells you what the letter codes mean, and how many files there were in each category. L E G E N D 23 - There was no change of any kind to the file; shown only in untouch.log. 3 + File's length changed. 10 ^ Untouch reverted the file to its old last-modified date/time. 0 ! File is new, at least to Untouch. 1 * File's contents changed, but it did not change length. 1 x File was locked and/or ignored. ICON **** Why the curly blue arrow icon? It represents settin the file date back to what it was.