# Best way to check if a folder is empty on MacOS given ".DS\_Store" files

**URL:** <https://discourse.julialang.org/t/best-way-to-check-if-a-folder-is-empty-on-macos-given-ds-store-files/96276>\
**Category:** New to Julia\
**Tags:** question, filesystem\
**Created:** [March 18, 2023, 9:23am UTC](https://discourse.julialang.org/t/best-way-to-check-if-a-folder-is-empty-on-macos-given-ds-store-files/96276 "2023-03-18T09:23:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phantom](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@phantom](https://discourse.julialang.org/u/phantom)\
**Post date:** [March 18, 2023, 9:23am UTC](https://discourse.julialang.org/t/best-way-to-check-if-a-folder-is-empty-on-macos-given-ds-store-files/96276/1 "2023-03-18T09:23:07Z")

</div>

Just wondering what the best way to check if a folder is empty on MacOs? Given that there always seems to be a “.DS\_Store” file `is empty("folder")` returns false even when there are no files in the folder.

The only way I can think of doing it is something like

```julia
readdir("File" == [".DS_Store"])

```

or I could try something like

```julia
filesize("Folder") < x 

```

but I’m not sure what the appropriate x would be given there could be another small file in the folder. Just wondering if this was the correct approach?
