It probably won't matter for directory sizes you actually encounter, but sorting the whole thing is unnecessary and you can use minimum to do this in O(n) time. Also probably a pointless optimization since doing the mtimes will dominate the sort time.
On Saturday, October 24, 2015, <[email protected]> wrote: > Works like a charm, thank you Stefan. > Final function I needed: > > function get_last_modified(path) > return first(sort(map(f -> (joinpath(path, f), > Dates.unix2datetime(mtime(f))), readdir(path)), by = last, rev = true))[1] > end > >
