What is the fastest way to test if a directory is empty?
Of course I can check the length of
list.files(path, all.files = TRUE, include.dirs = TRUE,
How about if(length(dir(all.files=TRUE)) ==0) ?
if(length(dir(all.files=TRUE)) ==0)
I'm not sure what you qualify as "fast," but if dir takes a long time, someone is abusing your filesystem :-(.
dir