[erlang-questions] Best way to check if a given directory is empty (or not)?

Wes James <>
Tue Mar 13 16:57:12 CET 2012


There is also filelib:file_size

Another thing to look at.  Can you keep track of when the folder is
first created:

 #file_info.atime (keep somwhere like ets table)

then later read #file_info.atime and compare?

The problem here is that when a file file is written or the folder is
just plane read (I did ls of folder and the atime changed) the atime
changes.

Will the folder ever be accessed other than to have a file be written
to it, if so, this may work.

-wes

On Tue, Mar 13, 2012 at 9:34 AM, Zabrane Mickael <> wrote:
>
> On Mar 13, 2012, at 4:33 PM, Wes James wrote:
>
>> Per Bengt's experience.  What happens if you add a file?  Does the size change?
>
> Nothing change when I added a file.
>
> Regards,
> Zabrane
>



More information about the erlang-questions mailing list