Clock.currTime

Kent via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Nov 20 07:45:55 PST 2014


On Thursday, 20 November 2014 at 15:38:10 UTC, Adam D. Ruppe
wrote:
> On Thursday, 20 November 2014 at 15:33:37 UTC, Kent wrote:
>>> mySorted.filter!(a => Clock.currTime - a.timeLastModified > 
>>> 14.days);
>>
>> Thank you for your reply.
>> But it still doesn't work.
>
> Are you sure you saw the important difference? There was a >> 
> in the first post and it should be >.
>
> There's a few times throughout chapter one and two of the book 
> where some symbols got messed up in the editing process and not 
> fixed by the final draft. This looks like one of them.

I have notice the difference.Changed the ">>" to ">".

void main(string[] argv)
{
      import std.file, std.algorithm, std.datetime,
std.range,std.stdio;
      DirEntry[] allFiles;
     foreach(DirEntry entry; dirEntries("E:/TDDOWNLOAD",
SpanMode.depth))
         allFiles ~= entry;
     auto sorted = sort!((a,b) => a.size > b.size)(allFiles);
     auto filtered =  filter!(a => Clock.currTime() -
a.timeLastModified > 14.days)(sorted);
     foreach(file; filtered.take!(10))
         writeln(fiel.name);
}


More information about the Digitalmars-d-learn mailing list