find file with relative time offset?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

find file with relative time offset?

Post by *sgp »

I just can't think of a way to do this with TC alone. Perhaps someone more knowledgeable about available plugins, or even AHK scripting could put me in the right direction?
Given two identical trees, I need to find all pairs of same-named files whose dates differ by a fixed amount. For instance given two folders:

Code: Select all

LEFT            RIGHT     
f1 10:15:01     f1 11:15:01        
f2 11:07:00     f2 12:07:00
f3 10:00:08     f3 10:00:08
Searching for time offset "+1 hour" should return filenames f1 and f2, because in the right side f1 and f2 are exactly one hour younger than their twins in the left side.
I'd appreciate any suggestion on how to use TC to find such files. Thanks.
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Try xxcopy. Features required are discussed here (switches DA#, DB#, etc).
Single user license #329241
PowerPro scripts for Total Commander
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

Vochomurka wrote:Try xxcopy
Thank you, nice idea. It seems that while xxcopy can compare files side-by-side as I need, it only allows for newer/older/same/different age comparisons, so I can't use a time offset as required. Thanks again.
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Not exactly.
xxcopy technical bulletin wrote:But, you may add a single-letter suffix (D, H, M, or S) to the value (for Days, Hours, Minutes or Seconds, respectively)
Examples:

XXCOPY src /S /LDT /DA#30M // list files made within 30 min.
XXCOPY src dst /s /DA#24H // copy files made within 24 hours
XXCOPY src dst /s /DA#0 // copy files made today (since midnight)
Single user license #329241
PowerPro scripts for Total Commander
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

Mmm, no, if I read the help file correctly, the above comparisons are relative to NOW, not to the source file age.
My interpretation of the help file is that source-destination file age comparisons are limited to newer/older/same/different time.
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

It seems you are right. In this case there is more complicated way.
This script can be modified as follows: it takes two files/dirs and finds time gap between their creation/modification/whatever event. But it does not correspond to your goal. You must take ALL files and compare each with ALL files, too, looking for a pair with 1 hour gap. But this is too time-consuming...
Another two tools dealing with time gaps (definitely NOT what you need): Redate and AddTime.
Single user license #329241
PowerPro scripts for Total Commander
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

Vochomurka wrote:It seems you are right. In this case there is more complicated way.
Yes, I was aware of that script, and pretty much of all your wonderful powerpro script collection, it's very good stuff! Thank you for sharing it.
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, sgp.

As the time difference of the files in question is exactly 1 hour, I wonder whether you have activated the following setting:
Configuration => Options => Operation => NTFS daylight saving correction - [X] Ignore 1 hour time delay
TC Helpfile wrote:This option lets Total Commander ignore this 1 hour difference in the time stamp in 'Synchronize dirs' and other compare functions.
Reason: When using Windows NT, 2000 or XP, it's possible to use two file systems, FAT32 or NTFS. While FAT32 stores the local time of files, NTFS stores the GMT (English standard time) of the files. When going from Summer (daylight saving) time to Winter (normal) time, the local timestamps on FAT32 will remain the same, while files on NTFS drives will have the time changed by 1 hour because the time zone difference to GMT changes by one hour. Therefore files on FAT32 and NTFS drives which had identical times before the time change will suddenly be different. Thanks to this function, the files can still be detected as identical.
Or did I misunderstand your intention and the 1 hour time difference was just a randomly chosen example?

Kind regards,
Karl
Last edited by karlchen on 2009-01-18, 15:29 UTC, edited 1 time in total.
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

karlchen wrote:[X] Ignore 1 hour time delay[/b]
Hi karl, indeed that option helped, although I still have some date offsets that are multiples of 1 hour, but they are just a few so I can fix them by hand.
Post Reply