I try to open a large number of files but after 5000 files or so I get
Exception in thread "Main" java.io.IOException: The device is not connected
Is this the expected behavior? Is there a way around it? I want to leave my code as straightforward as possible.