Is there a way to get the number of files in a given directory without looping it?