Fast test if directory is empty Fast test if directory is empty r r

Fast test if directory is empty


How about 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 :-(.