I'm trying to create a program to find all files by a certain name on a Linux server, and then pipe their absolute paths into an ArrayList for processing. My method of using a Process (with exec) and a BufferedReader seems to have worked for all my other needs (various other commands du -h df-h, etc...) however, it doesn't seem to be working in this case in that I get no data outputted! It does seem to be executing as it takes a minute or two to complete but I never see any data result.
Here is the code: (without try/catch which just prints stack trace)
Process process =
Runtime.getRuntime().exec("find " + Main.serversPath + " -name 'dynmap'");
BufferedReader stdInput = new BufferedReader(
new InputStreamReader(process.getInputStream()));
while ((s = stdInput.readLine()) != null) {
filesToDelete.add(s);
if (Main.debugMode == "High") {
System.out.println("Preprocess: dynmap pass - found " + s);
}
}
process.destroy();