Author |
Topic: Strong possibility of serious bug! (Read 2690 times) |
|
JohnPap
Senior Member
   
member is offline


Gender: 
Posts: 353
|
 |
Strong possibility of serious bug!
« Thread started on: Jun 12th, 2009, 11:35am » |
|
Hello Tom,
The description of the Bart job is as follows:
Source directory on FAT32 partition L:\Transfers\KEIMENA > KEIMENA is Greek for DOCUMENTS <
File #1 [not encrypted, password protected using Word's password protection scheme] in Source directory : Name Αυτόματες Ενημερώσεις.docx > Αυτόματες Ενημερώσεις is Greek for Automatic Updates < Size 54.784 bytes Size on disk 57.344 bytes Created Saturday, May 9, 2009, 08:57:50 Modified Friday, May 15, 2009, 14:16:12 Accessed Today, June 12, 2009
File #2 [not encrypted, password protected using Word's password protection scheme] in Source directory: Name Ιστορικόν - WinXP.docx > Ιστορικόν is Greek for History of < Size 79.360 bytes Size on disk 81.920 bytes Created Saturday, May 9, 2009, 08:57:52 Modified Monday, May 18, 2009, 14:20:30 Accessed Today, June 12, 2009
Target directory on NTFS partition F:\KEIMENA
File #1 [encrypted using Windows' encryption scheme, password protected using Word's password protection scheme] in Target directory : Name Αυτόματες Ενημερώσεις.docx Size 53.760 bytes Size on disk 54.272 bytes Created Wednesday, May 6, 2009, 14:40:32 Modified Today, June 12, 2009, 17:17:24 Accessed Today, June 12, 2009, 17:59:47
File #2 [encrypted using Windows' encryption scheme, password protected using Word's password protection scheme] in Target directory: Name Ιστορικόν - WinXP.docx Size 79.360 bytes Size on disk 79.872 bytes Created Wednesday, May 6, 2009, 14:40:33 Modified Today, June 12, 2009, 16:29:04 Accessed Today, June 12, 2009, 17:57:20
Whenever I run this Bart job, Source File #1 overwrites Target File #1.
Something is definitely wrong here, especially if you consider the fact that Source File #2 does NOT overwrite Target File #2!
Any ideas?
Regards, John
|
|
Logged
|
|
|
|
Tom Revell
Administrator
    
member is offline


Gender: 
Posts: 1978
|
 |
Re: Strong possibility of serious bug!
« Reply #1 on: Jun 18th, 2009, 02:40am » |
|
To be sure, the incorrect behaviour as I see it in your example is that both files are not overwritten.
Both files need to be updated/copied, as they both differ.
Nonetheless, I have found a bug as you suspected - it relates to the CTimeSpan class and how the comparison works. I compare the two modification dates, stored as CTime objects, and get a CTimeSpan object. Then that is compared with a new object constructed as CTimeSpan(0,0,0,4) - four seconds. This is needed as FAT32 filesystems only have a resolution of four seconds.
My incorrect assumption was that the CTimeSpan was always positive - a span of time can't be negative. However, it seems the value can be positive or negative to indicate a difference into either the past or the future.
Could you confirm the above - that the unexpected behaviour is as I suggest, and I'll also send you an exe with the extra check in to see whether you agree that resolves the problem.
Thanks for this,
Tom
|
|
Logged
|
|
|
|
JohnPap
Senior Member
   
member is offline


Gender: 
Posts: 353
|
 |
Re: Strong possibility of serious bug!
« Reply #2 on: Jun 19th, 2009, 09:54am » |
|
on Jun 18th, 2009, 02:40am, Tom Revell wrote:... Both files need to be updated/copied, as they both differ. ... |
|
Hello Tom,
Thanks for the exe; I haven't yet tried it though, because I would like to clear things out my mind.
You say that both files need to be updated/copied, as they both differ.
As I understand it, none of the files in the target should be updated/copied because the files in the target directory are newer (according to their modification date/time stamp). Or am I missing something?
Regards, John
UPDATE
I tested the exe you sent me and it now updates both files in the target. However, like I wondered above, is this the normal behaviour? The files in the source directory are older compared to the files in the target.
|
| « Last Edit: Jun 19th, 2009, 10:38am by JohnPap » |
Logged
|
|
|
|
sooyke
Guest
|
 |
Re: Strong possibility of serious bug!
« Reply #3 on: Jun 19th, 2009, 11:48am » |
|
Hi John,
Quote:Destination
The destination folder is kept synchronised with the source. Any changes which are made to the destination would be overwritten the next time Bart is run - to this end do not edit files in the destination, or save anything new! The syncronisation is one-way, and is complete. |
|
....or did you not click the I agree statement before using it 
have a nice weekend
Sooyke
|
| « Last Edit: Jun 19th, 2009, 12:02pm by sooyke » |
Logged
|
|
|
|
JohnPap
Senior Member
   
member is offline


Gender: 
Posts: 353
|
 |
Re: Strong possibility of serious bug!
« Reply #4 on: Jun 19th, 2009, 8:52pm » |
|
Hello Sooyke,
Fair enough! 
So the modified date/time stamp check is there only for Bart to avoid any redundant copying of files from the source to the target... in which case, the exe Tom sent me has corrected the bug.
Regards, John
EDIT
OMG! I just noticed that I got another star and that my rank changed to Senior Member!!!
|
| « Last Edit: Jun 19th, 2009, 8:56pm by JohnPap » |
Logged
|
|
|
|
Tom Revell
Administrator
    
member is offline


Gender: 
Posts: 1978
|
 |
Re: Strong possibility of serious bug!
« Reply #5 on: Jun 20th, 2009, 4:12pm » |
|
Sooyke's right - bart is designed to do one-way sync, so although you thought you'd found a different bug, you did nonetheless find a bug, thanks.
I've uploaded the fixed version now.
There's just one (non-administrative) level above Senior Member - it comes at 500 posts. Sooyke's not that far from it now - but what do you think the title should be? "Stickiest Member", "Uber Member", "Most Helpful Member" !
Tom
|
|
Logged
|
|
|
|
JohnPap
Senior Member
   
member is offline


Gender: 
Posts: 353
|
 |
Re: Strong possibility of serious bug!
« Reply #6 on: Jun 21st, 2009, 01:07am » |
|
To be honest, bumping into the bug was purely accidental. You see I have certain certain rules for using Bart on two different computers. One day I decided to violate these rules just to see if anything would happen and sure enough something happened!!! - praise Murphy and his laws 
Regarding the ranking system, "Stickiest Member" is a very clever title. One word I love very much is "Cardinal", so I could also suggest "Cardinal Member". 
Regards, John
|
|
Logged
|
|
|
|
|