Algorithm to determine if a file was modified today

John Colvin john.loughran.colvin at gmail.com
Thu Feb 21 05:50:03 PST 2013


On Thursday, 21 February 2013 at 12:40:37 UTC, Lubos Pintes wrote:
> Hi,
> Can someone tell me an algorithm which determines if a file 
> specified by its name was modified today?
> I suspect that I will need a std.datetime module to work with 
> dates, and something from somewhere that would tell me the 
> modification date and then convert and compare.
> But std.datetime is quite large... Sorry if this looks like 
> laziness. :-)
> Thank.

http://dlang.org/phobos/std_file.html#timeLastModified

and then you should be able to very easily use the methods etc. 
of http://dlang.org/phobos/std_datetime.html#.SysTime to work out 
whether it was modified on any particular day.


More information about the Digitalmars-d-learn mailing list