File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes Too many open files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Java » I/O and Streams
Bookmark " Too many open files" Watch " Too many open files" New topic
Author Too many open files

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 744

Here is my code to copy file

Error that am facing is:

Thanks in anticipation
Paul Clapham

Joined: Oct 14, 2005
Posts: 19312

As far as I can see, the code that you posted doesn't have anything to do with your error message. Here's the relevant part of the stack trace:

Notice that the classes and mentioned in that stack trace are not in the code which you posted.
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 744
Thanks Paul Clapham for your favorable reply. Actually the referred classes are using this copy method and exist in the class from where this copyFile method called

I googled and found this problem not belongs to my code but appearing due to Linux as permission to view number of files were 1024 whereas I was trying to copy 50500 files. I used the following to fix it:

Increase open files and max user processes:

Presently it seems the problem fixed but am still waiting to be sure 100%

Thanks again
Consider Paul's rocket mass heater.
subject: Too many open files