From: Turpin, Jay <jay.turpin@in...> - 2001-10-10 16:06:50
OK. I'll take care of that.
Additionally, I think I've found a bug with the File.GetLastWriteTime()
method. This code should ASSERT to TRUE:
string destination = @"c:\temp\logo.txt";
StreamWriter writer = File.CreateText(destination);
writer.Write("It's OK to delete this file.");
DateTime touchDate = DateTime.Parse("2000/12/31 23:59");
DateTime lastWriteTime = File.GetLastWriteTime(destination);
TimeSpan timeSpan = touchDate.Subtract(lastWriteTime);
string tmp = timeSpan.ToString();
// This assert fails
FileInfo fileInfo = new FileInfo(destination);
fileInfo.LastWriteTime = touchDate;
lastWriteTime = fileInfo.LastWriteTime;
timeSpan = touchDate.Subtract(lastWriteTime);
tmp = timeSpan.ToString();
// This assert succeeds
But for me, File.GetLastWriteTime() returns a time that is 2-3 minutes
earlier than the "real" LastWriteTime. I visually verified the file
Can anyone else reproduce this?
"Don't take yourself too serious, nobody else does." - Clint Eastwood
From: Gerry Shaw [mailto:gerry_shaw@...]
Sent: Tuesday, October 09, 2001 4:06 PM
Subject: RE: [nant-dev] Touch and Get implementation questions
> My take is that only the LastWriteTime should be updated. Opinions?
This seems like a reasonable thing to do. It should probably be documented
in the <remarks> section of the task class to avoid any ambiguity.
> -----Original Message-----
> From: nant-developers-admin@...
> [mailto:nant-developers-admin@...] On
> Behalf Of Turpin, Jay
> Sent: October 9, 2001 3:25 PM
> To: nant-developers@...
> Subject: [nant-dev] Touch and Get implementation questions
> Here's a nit-picky implementation question regarding touch:
> When a file is "touched" would you expect both the
> CreationTime and LastWriteTime to be changed to the touched
> date, or just the LastWriteTime?
> Also, for get: When you "get" a file, would you expect the
> CreationTime and LastWriteTime to match? I ask because I
> running into problems trying to "test" if a new file has been
> downloaded. If the file already exists locally, "get" simply
> opens the file and updates it with the new content, leaving
> the create date the same.
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Nant-developers mailing list