<p>There might be an obvious solution. That is, if certain file is bound to be present out of that 150k files, then you can just check the presence of that particular file. </p>
<div class="gmail_quote">On Mar 13, 2012 2:10 PM, "Zabrane Mickael" <<a href="mailto:zabrane3@gmail.com">zabrane3@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi guys,<br>
<br>
I'd like to know if there's a good and portable method to check if a directory is empty (or not)?<br>
In my case, the directory can contains huge number (more than 150K in average) of files if it is not empty.<br>
<br>
I've tested the following working calls:<br>
a. file:list_dir/1<br>
b. filelib:wildcard/2<br>
<br>
The problem with them is they both return a list of filenames.<br>
I'd like to avoid getting this list back to be able to check if it's empty or not.<br>
<br>
Advices please?<br>
<br>
Regards<br>
Zabrane<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>