G
guba
Hello,
I am searching the most efficient way to get the number of files
in a directory (up to 10^6 files). I will use the nr as a stop
condition
of of generation process so the method must be applied during this
process
a lot of times. Therefore it must be efficient and opendir is not the
choice.
I am thinking about the bash command "ls | wc -l"
but I don't know how to get this in a perl variable.
Thank you very much for any help!
I am searching the most efficient way to get the number of files
in a directory (up to 10^6 files). I will use the nr as a stop
condition
of of generation process so the method must be applied during this
process
a lot of times. Therefore it must be efficient and opendir is not the
choice.
I am thinking about the bash command "ls | wc -l"
but I don't know how to get this in a perl variable.
Thank you very much for any help!