# DirectoryIterator wrong assert

**URL:** <https://forum.juce.com/t/directoryiterator-wrong-assert/2277>\
**Category:** General JUCE discussion\
**Created:** [November 12, 2007, 1:31pm UTC](https://forum.juce.com/t/directoryiterator-wrong-assert/2277 "2007-11-12T13:31:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [November 12, 2007, 1:31pm UTC](https://forum.juce.com/t/directoryiterator-wrong-assert/2277/1 "2007-11-12T13:31:02Z")

</div>

Hi Jules,

in the DirectoryIterator ctor  
there is the following assert.

// you have to specify the type of files you’re looking for!  
jassert (whatToLookFor \> 0 && whatToLookFor \<= 3);

Problem is, it asserts when you gives  
juce::File::findFilesAndDirectories | juce::File::ignoreHiddenFiles  
which is valid.

jassert (whatToLookFor \> 0 && whatToLookFor \<= 7);  
should be the right test

Thanks,

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [November 12, 2007, 1:59pm UTC](https://forum.juce.com/t/directoryiterator-wrong-assert/2277/2 "2007-11-12T13:59:03Z")

</div>

Ok, thanks! Looks like an old assertion that needed updating.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 12, 2017, 10:06am UTC](https://forum.juce.com/t/directoryiterator-wrong-assert/2277/3 "2017-05-12T10:06:15Z")

</div>

Closed on May 12, 2017, 10:06am UTC


