<div dir="ltr"><div dir="ltr"><div dir="ltr">Anyway, this means the only way for me to deal with this is to close the directory EVERY time right after I open it. But it's not ideal for the design of this object, where I wanted it to leave the directory open so we could keep querying for files without the need to reopen it every time. I guess I can just deal with this by opening/closing all the time, but it kinda sucks... Unless the wizards out there have a magical way out for me :) <br><br>I could also try and see how other Pd objects deal with this... I'm using [dir] to remove my dependency of [playlist], haven't tested how it'd behave in this situation, probably fine. I have tested [hcs/folder_list] though, it does this sort of thing and doesn't seem to crash!<br><br>Well, let me go ahead and sort this out, thanks a lot for your help!</div><div dir="ltr"><br></div><div>cheers</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em sex, 8 de fev de 2019 às 15:59, Alexandre Torres Porres <<a href="mailto:porres@gmail.com">porres@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Em sex, 8 de fev de 2019 às 13:55, Alexandre Torres Porres <<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>> escreveu:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<a href="https://github.com/porres/pd-else/blob/9b259f24569a13069c5842ec0f598e8fe96c8cbc/Classes/Source/dir.c#L75" rel="noreferrer" target="_blank">https://github.com/porres/pd-else/blob/9b259f24569a13069c5842ec0f598e8fe96c8cbc/Classes/Source/dir.c#L75</a><br><br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
the leak seems to be on this line.  you should keep the return value of <br>
opendir and be sure to close it when no longer necessary.<br></blockquote></div></div></blockquote><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Well, I'll take there must be a leak or something there, but I'm calling this method (<span style="color:rgb(111,66,193);white-space:pre-wrap">dir_open</span>) in the patch. This object opens directories so we query for filenames in it, and for that it depends on <<span style="color:rgb(0,0,0)">dirent.h</span>>. And the thing is that if there are too many opened directories, crap happens. I've tried everything already, but it seems to be an issue with the opendir() function in dirent.h</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">See <a href="http://pubs.opengroup.org/onlinepubs/7908799/xsh/opendir.html" target="_blank">http://pubs.opengroup.org/onlinepubs/7908799/xsh/opendir.html</a> where it says "<u>applications will only be able to open up to a total of {OPEN_MAX} files and directories</u>", that might be it. Also, the given errirs in that page mention "<span style="color:rgb(0,0,0)">descriptors" and how "</span><span style="color:rgb(0,0,0)">Too many files are currently open in the system".</span></font></div><div><br></div><div><div dir="ltr" class="gmail_attr"><br class="gmail-m_2881474532235629331gmail-Apple-interchange-newline">Em sex, 8 de fev de 2019 às 07:58, Roman Haefeli <<a href="mailto:reduzent@gmail.com" target="_blank">reduzent@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Maybe you closed them, despite them not being fixed.</blockquote><div><br></div><div>I may have closed yours because it was a duplicate issue, also reported/discussed here <a href="https://github.com/porres/pd-else/issues/248" target="_blank">https://github.com/porres/pd-else/issues/248</a> by Liam.</div><div><br></div><div>cheers</div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
</blockquote></div></div></div></div></div></div>
</blockquote></div>