From a26d7909e55f35542fa442a7cbfefaadc0b4ad2d Mon Sep 17 00:00:00 2001 From: Paolo Inglese <26252284+piplus2@users.noreply.github.com> Date: Fri, 30 May 2025 12:38:55 +0200 Subject: [PATCH] warning if expected files are not found When the directory passed as argument doesn't contain the expected files, the user should get a feedback. Otherwise, the statistics would be misleading without the user realising it. --- AWS/scripts/LibraryComplexity.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/AWS/scripts/LibraryComplexity.java b/AWS/scripts/LibraryComplexity.java index e6eb851..c37d8ff 100755 --- a/AWS/scripts/LibraryComplexity.java +++ b/AWS/scripts/LibraryComplexity.java @@ -52,20 +52,26 @@ public static void main(String[] args) { reader = new BufferedReader(new FileReader(f)); while (reader.readLine() != null) opticalDups++; reader.close(); - } + } else { + System.out.println("Warning: opt_dups.txt not found in the directory"); + } f = new File(args[0] + "/merged_nodups.txt"); if (f.exists()) { reader = new BufferedReader(new FileReader(f)); while (reader.readLine() != null) uniqueReadPairs++; reader.close(); - } + } else { + System.out.println("Warning: merged_nodups.txt not found in the directory"); + } f = new File(args[0] + "/dups.txt"); if (f.exists()) { reader = new BufferedReader(new FileReader(args[0] + "/dups.txt")); while (reader.readLine() != null) readPairs++; reader.close(); readPairs += uniqueReadPairs; - } + } else { + System.out.println("Warning: dups.txt not found in the directory"); + } String fname = "inter.txt"; if (args.length == 2) fname = args[1]; f = new File(args[0] + "/" + fname); @@ -87,7 +93,9 @@ public static void main(String[] args) { line = reader.readLine(); } reader.close(); - } + } else { + System.out.println("Warning: inter.txt not found"); + } } catch (IOException error) { System.err.println("Problem counting lines in merged_nodups and dups"); System.exit(1);