From: Ron G. <ron...@ya...> - 2009-01-28 20:57:37
|
What FTP task are you referring to? This one from Google? http://www.google.com/search?q=nant+ftp+task http://www.spinthemoose.com/~ftptask/ If so, it looks like the date comparisons are hard-coded: // snip DateTime.Compare( _client.ModTime(Path.GetFileName(remoteFilePath)), (new FileInfo(fileName)).LastWriteTime)>=0 // snip this.Log(this.LevelLogfiles, "Remote file is newer."); It doesn't look like it can be easily extended. The task comes with a build script. You could modify the code then submit your changes back to the author. Maybe move DateTime.Compare into an interface: public interface IDateTimeCompare { int Compare(DateTime t1, DateTime t2); } public class DefaultDateTimeCompare : IDateTimeCompare { public int Compare(DateTime t1, DateTime t2) { return DateTime.Compare(t1, t2); } } public class OneHourBehindDateTimeCompare : IDateTimeCompare { public int Compare(DateTime t1, DateTime t2) { return DateTime.Compare(t1.AddHours(-1), t2); } } Or add a timeOffset attribute to the connection task and move the DateTime.Compare calls into a helper method that normalizes the times. ----- Original Message ---- From: Karl Stubsjoen <ks...@gm...> To: nan...@li... Sent: Wednesday, January 28, 2009 3:03:34 PM Subject: Re: [NAnt-users] FTP Task Does anyone have any ideas on this?? On Tue, Jan 27, 2009 at 10:18 AM, Karl Stubsjoen <ks...@gm...> wrote: > Hello, > I need to make a tweak to the FTP task. When it compares dates from > my local system to remote system, the date of the remote system is off > by 1 hour, so code I've made changes to inside this hour do not get > ftp'd when overwrite is false. I'm hoping to: > > a) configure the FTP task somehow > b) tweak the source code > > If option b, where can I find the source code? > > Thanks, > > Karl.. > ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ NAnt-users mailing list NAn...@li... https://lists.sourceforge.net/lists/listinfo/nant-users |