|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
deleting files greater than x daysi m looking for suggestions in this news groups what is the best way to
delete files greater than x days. scenario / conditions a) d:\dir\queue\*.* files to be deleted. b) no-touch solutions : use filewatcher on the above directory ? c) the program will run locally on each machine ..or shld i run poll threads (control by single machine to check other machines, so exe program only reside on one system ?) how shld i "poll" in such a way that in the above directory, it will auto-delete files greater than 7 days ? i m open to ideas ... Hi James
Write a system service or use the scheduler? The KISS solution would be a batch file invoked via the scheduler. Martin "James" <jkk***@hotmail.com> schrieb: In addition to the other replies: You can use >i m looking for suggestions in this news groups what is the best way to >delete files greater than x days. 'System.IO.File.GetLastWriteTime' to determine when the file has been altered the last time. Then you can subtract this date from 'Now' and check the 'TotalDays' of the resulting 'TimeSpan' object. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Show Modal, then Again
TopMost without SetFocus throw/handle exceptions while using backgroundworker DUMB question about IndexOf What is the correct case convention for Set? Listbox idiotic example progress bar right to left Importing XML File into an Empty Access Table How to use a Generic's base type? RDA with limited connectivity |
|||||||||||||||||||||||