> ## Content Index
> Fetch the complete content index at: https://helpmonks.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# CFML and Cannot run program - too many files open
- URL: https://helpmonks.com/blog/cfml-and-cannot-run-program-chmod-java-io-ioexception-error24-too-many-open-files/
- Published: 2011-12-31T00:00:00.000Z
- Updated: 2026-04-04T01:57:53.000Z
- Description: Migrating one of my customers the other day, bought up an ugly error when I had to create 2000 directories on one go. The error was: While, “too many open fi
- Author: Nitai
- Tags: email marketing

Migrating one of my customers the other day, bought up an ugly error when I had to create 2000 directories on one go. The error was:

\[code\]Cannot run program "chmod": java.io.IOException: error=24, Too many open files\[/code\]

While, “too many open files” usually means one can raise the limit of open files under Linux (check out ulimit -a) it unfortunately did not help in this situation. I even rebooted the whole server and made sure that no other service was running, except Java that is. Still no success.

I then looked at my code in the CFML (Coldfusion) template. In order to create the directories I used a simply:

\[coldfusion\]<cfinclude action="create" directory="…" mode="775">\[/coldfusion\]

Normal code, right? Well, as it turns out, I simply had to remove the “mode” part in order to overcome this error. Not sure, why this caused a “too many open files” error, but it worked in my situation. I can only imagine that the server tried to put all 2000 directories into memory and then write them in one go (I have a high value for the open files limit set and 12GB RAM).

In any case, hope this helps someone out here.