If you just want to clean logs, then use modification time on all oses: auto clogClean (string LogDir ) { Array!(Tuple!(string, SysTime)) dFiles; dFiles.insert(dirEntries(LogDir, SpanMode.shallow).filter!(a => a.isFile).map!(a => tuple(a.name, a.timeLastModified))); return dFiles; }