FileTime> and copyied file is wrong

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Snickers
Macro Veteran
Posts: 151
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

FileTime> and copyied file is wrong

Post by Snickers » Thu Jul 17, 2008 8:41 pm

I am creating a simple code that will check to see if my local excel document matches the document on another network drive.

Everyday, I edit a spreadsheet. Then I save my sheet and right click drag it to the other location and select copy here.

When I run the following code, the FileTime> data for the network drive retrieved is always 2 seconds BEFORE the original file.

The network file = the copy = 2 seconds earlier filetime>
the local = the original = normal filetime>


[code]
goSub>subVarDeclare

FileDate>%PB_ExcelFilePath%,curDate
FileTime>%PB_ExcelFilePath%,curTime
FileDate>%Nuke_PB_ExcelFilePath%,preNukeDate
FileTime>%Nuke_PB_ExcelFilePath%,preNukeTime
MDL>%curDate% %curTime% %preNukeDate% %preNukeTime%

//subVarDeclare--------------------------------------subVarDeclare
SRT>subVarDeclare
Let>Nuke_PB_ExcelFilePath=...networkpath...
Let>PB_ExcelFilePath=...localpath...
End>subVarDeclare
[/code]

OUTPUT
[code]
20080717 163144 20080717 163142
[/code]

Why is it doing that?

Snickers
Macro Veteran
Posts: 151
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

Post by Snickers » Tue Jul 22, 2008 12:49 pm

This is occurring again. Has anyone been able to reproduce this error? It was not happening yesterday; however, it is happening again today.

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jul 22, 2008 2:00 pm

I experimented with this thinking that perhaps there was a small difference between the time on your server and the time on your computer. In that condition if a file is "created" on each location, for example using WriteLn>, the two file times will match the time on the computer on which the file was created. But when I "copy" a file from one computer to the other, the time always remains exactly the same. My PC is Win XP. I tested with 3 servers, Win 2000, Win 2003, and Red Hat Linux using SMB.

Snickers
Macro Veteran
Posts: 151
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

Post by Snickers » Mon Jul 28, 2008 4:45 pm

The error is intermittent I have corrected it by allowing for a 2 second gap. I find it very odd that when I drag the original file over to a network drive, the copied version writes itself as having been modified 2 seconds earlier than the original file...according to macro scheduler.

Thank you for testing it out.

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Jul 28, 2008 6:06 pm

I find it very odd that when I drag the original file over to a network drive, the copied version writes itself as having been modified 2 seconds earlier than the original file
This also occurs when you "Drag" a file? That makes it sound more like a system issue rather than a Macro Scheduler issue

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts