From 15f6c2cd2eb6ff39f4f196dc40b293bc83053a41 Mon Sep 17 00:00:00 2001 From: Schroeder Date: Wed, 16 Oct 2019 21:37:17 +0000 Subject: [PATCH 02/13] --- .classpath | 11 +++++++ .project | 18 +++++++++++ src/dev/rsems/treesize/j/Directory.java | 55 ++++++++++++++++++++++++++++++++ src/dev/rsems/treesize/j/Test.java | 49 ++++++++++++++++++++++++++++ src/dev/rsems/treesize/s/Directory.scala | 23 +++++++++++++ src/dev/rsems/treesize/s/Test.scala | 48 ++++++++++++++++++++++++++++ 6 files changed, 204 insertions(+) create mode 100755 .classpath create mode 100755 .project create mode 100755 src/dev/rsems/treesize/j/Directory.java create mode 100755 src/dev/rsems/treesize/j/Test.java create mode 100755 src/dev/rsems/treesize/s/Directory.scala create mode 100755 src/dev/rsems/treesize/s/Test.scala diff --git a/.classpath b/.classpath new file mode 100755 index 0000000..541d5b4 --- /dev/null +++ b/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/.project b/.project new file mode 100755 index 0000000..bd10b60 --- /dev/null +++ b/.project @@ -0,0 +1,18 @@ + + + TreeSize + + + + + + org.scala-ide.sdt.core.scalabuilder + + + + + + org.scala-ide.sdt.core.scalanature + org.eclipse.jdt.core.javanature + + diff --git a/src/dev/rsems/treesize/j/Directory.java b/src/dev/rsems/treesize/j/Directory.java new file mode 100755 index 0000000..0da3f82 --- /dev/null +++ b/src/dev/rsems/treesize/j/Directory.java @@ -0,0 +1,55 @@ +package dev.rsems.treesize.j; + +import java.io.File; +import java.io.FileFilter; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +public class Directory { + Directory parent; + File fsdir; + Long localSize; + Long totalSize; + List children; + + public Directory(Directory parent, File fsdir) { + this.parent = parent; + this.fsdir = fsdir; + File[] files = fsdir.listFiles(new FileFilter() { + @Override + public boolean accept(File f) { + return f.isFile() && !Files.isSymbolicLink(f.toPath()); + } + }); + localSize = 0L; + if (files != null) { + for (int i = 0; i < files.length; i++) { + localSize += files[i].length(); + } + } + File[] fsdirs = fsdir.listFiles(new FileFilter() { + @Override + public boolean accept(File f) { + return f.isDirectory() && !Files.isSymbolicLink(f.toPath()); + } + }); + children = new ArrayList<>(); + totalSize = localSize; + if (fsdirs != null) { + for (int i = 0; i < fsdirs.length; i++) { + Directory subdirectory = new Directory(this, fsdirs[i]); + children.add(subdirectory); + totalSize += subdirectory.totalSize; + } + Collections.sort(children, new Comparator() { + @Override + public int compare(Directory d1, Directory d2) { + return -d1.totalSize.compareTo(d2.totalSize); + } + }); + } + } +} diff --git a/src/dev/rsems/treesize/j/Test.java b/src/dev/rsems/treesize/j/Test.java new file mode 100755 index 0000000..e22e7e3 --- /dev/null +++ b/src/dev/rsems/treesize/j/Test.java @@ -0,0 +1,49 @@ +package dev.rsems.treesize.j; + +import java.io.File; +import java.io.IOException; +import java.util.List; + +public class Test { + + static void recurse(Directory d, int level) { + List subs = d.children; + for (int i = 0; i < subs.size(); i++) { + Directory child = subs.get(i); + Long ts = child.totalSize; + if (true) /* (ts >= 100000000L) */ { + StringBuilder sb = new StringBuilder(String.format("%,16d ", ts)); + String s = ""; + Directory temp = child; + int loop = 0; + while (temp.parent != null) { + /* ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ */ + if (temp.parent.children.indexOf(temp) == temp.parent.children.size() - 1) { + if (loop == 0) { + s = " └── " + s; + } else { + s = " " + s; + } + } else if (loop == 0) { + s = " ├── " + s; + } else { + s = " │ " + s; + } + temp = temp.parent; + loop++; + } + sb.append(s).append(child.fsdir.getName()); + System.out.println(sb.toString()); + } + if (level <= 4) recurse(child, level + 1); + } + } + + public static void main(String[] args) throws IOException { + Directory d = new Directory(null, new File("/home/rob")); + String s = String.format("%,16d", d.totalSize) + " " + d.fsdir.getCanonicalPath(); + System.out.println(s); + recurse(d, 1); + } + +} diff --git a/src/dev/rsems/treesize/s/Directory.scala b/src/dev/rsems/treesize/s/Directory.scala new file mode 100755 index 0000000..6741af8 --- /dev/null +++ b/src/dev/rsems/treesize/s/Directory.scala @@ -0,0 +1,23 @@ +package dev.rsems.treesize.s + +import java.io.File +import java.nio.file.Files +import scala.collection.mutable.ListBuffer + +class Directory(val fsdir: File, val parent: Directory = null, val sort: Boolean = false) { + private var localSize = 0L + var children = ListBuffer[Directory]() + private val files = fsdir.listFiles + if (files != null) + localSize = files.filter(f => f.isFile() && !Files.isSymbolicLink(f.toPath)).map(f => f.length).sum + var totalSize = localSize + private val dirs = fsdir.listFiles + if (dirs != null) { + totalSize += dirs.filter(f => f.isDirectory() && !Files.isSymbolicLink(f.toPath)).map(dir => { + val subdir = new Directory(dir, this, sort) + children += subdir + subdir.totalSize + }).sum + if (sort) children = children.sortBy(-_.totalSize) + } +} \ No newline at end of file diff --git a/src/dev/rsems/treesize/s/Test.scala b/src/dev/rsems/treesize/s/Test.scala new file mode 100755 index 0000000..4dbf534 --- /dev/null +++ b/src/dev/rsems/treesize/s/Test.scala @@ -0,0 +1,48 @@ +package dev.rsems.treesize.s + +import java.io.File + +object Test extends App { + // ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ + val LineUpAndRight = " \u2514\u2500\u2500 "; // " └── " + val LineBlank = " "; + val LineVerticalAndRight = " \u251c\u2500\u2500 "; // " ├── " + val LineVertical = " \u2502 "; // " │ " + + def recurse(d: Directory, level: Int) { + for (child <- d.children) { + val ts = child.totalSize + val sb = new StringBuilder("%,16d ".format(ts)) + var s = "" + var temp = child + var loop = 0 + while (temp.parent != null) { + if (temp.parent.children.indexOf(temp) == temp.parent.children.size - 1) { + if (loop == 0) { + s = "└─ " + s + } else { + s = " " + s + } + } else if (loop == 0) { + s = "├─ " + s + } else { + s = "│ " + s + } + temp = temp.parent + loop += 1 + } + sb.append(s).append(child.fsdir.getName) + println(sb.toString) + + // if (level <= 4) + + recurse(child, level + 1) + + } + } + + val dir = new Directory(new File("/home/rob")) + val s = "%,16d".format(dir.totalSize) + " " + dir.fsdir.getCanonicalPath + println(s) + recurse(dir, 1) +} \ No newline at end of file From c1c0553852da7ec4bcc1ae02a18f70b3d84a9345 Mon Sep 17 00:00:00 2001 From: Schroeder Date: Thu, 2 Jun 2022 20:39:49 +0200 Subject: [PATCH 04/13] .gitignore added --- .gitignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 From 8b8d38fb63fb520cf97e3690d7bf52501c5815bd Mon Sep 17 00:00:00 2001 From: Schroeder Date: Thu, 2 Jun 2022 22:13:53 +0200 Subject: [PATCH 05/13] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20hinzuf?= =?UTF-8?q?=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 From 4ec10f47dabd5b93f1b0d32aaa9f8d398c3ef4dc Mon Sep 17 00:00:00 2001 From: Schroeder Date: Thu, 2 Jun 2022 22:21:19 +0200 Subject: [PATCH 06/13] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index e69de29..547062c 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,6 @@ +# treesize + +Quick-and-dirty-Implementation des tree-Kommandos (Linux), einmal in Java und einmal in Scala + +___ +RS 16-Oct-2019 \ No newline at end of file From 3ab8dd31540223495af42df51a66d75fdb698922 Mon Sep 17 00:00:00 2001 From: Schroeder Date: Thu, 2 Jun 2022 22:43:47 +0200 Subject: [PATCH 07/13] editiert --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 547062c..1e89b48 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,7 @@ Quick-and-dirty-Implementation des tree-Kommandos (Linux), einmal in Java und einmal in Scala +* 16-Oct-2019 Erstellt und in svn-Repo hochgeladen +* 02-Jun-2022 Mit git2svn in lokales git-Repo migriert und in selbstgehosteten Gitea-Server gepusht ___ -RS 16-Oct-2019 \ No newline at end of file +RS 16-Oct-2019 From 7b01d487ed3d665d747eb0dcc9592ace241a04a7 Mon Sep 17 00:00:00 2001 From: Schroeder Date: Thu, 2 Jun 2022 22:45:06 +0200 Subject: [PATCH 08/13] editert --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e89b48..009d807 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,4 @@ Quick-and-dirty-Implementation des tree-Kommandos (Linux), einmal in Java und ei * 16-Oct-2019 Erstellt und in svn-Repo hochgeladen * 02-Jun-2022 Mit git2svn in lokales git-Repo migriert und in selbstgehosteten Gitea-Server gepusht ___ -RS 16-Oct-2019 +RS 02-Jun-2022 From 3528e353f3888e8d0d7958ec341fe98ead477438 Mon Sep 17 00:00:00 2001 From: Schroeder Date: Thu, 2 Jun 2022 22:46:53 +0200 Subject: [PATCH 09/13] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 009d807..1ac7514 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # treesize -Quick-and-dirty-Implementation des tree-Kommandos (Linux), einmal in Java und einmal in Scala +Rudimentäre Quick-and-dirty-Implementation des tree-Kommandos (Linux), einmal in Java und einmal in Scala * 16-Oct-2019 Erstellt und in svn-Repo hochgeladen * 02-Jun-2022 Mit git2svn in lokales git-Repo migriert und in selbstgehosteten Gitea-Server gepusht ___ -RS 02-Jun-2022 +RS 02-Jun-2022 \ No newline at end of file From af61f3748a7e7d6af80eed17596c97e114ef0f7a Mon Sep 17 00:00:00 2001 From: Robert Schroeder Date: Tue, 16 Aug 2022 17:08:30 +0200 Subject: [PATCH 10/13] Added listing of files --- .classpath | 18 +++--- .project | 1 - README.md | 14 ++--- src/dev/rsems/treesize/j/Directory.java | 3 +- src/dev/rsems/treesize/j/Test.java | 56 ++++++++++++++++--- src/dev/rsems/treesize/s/Directory.scala | 44 +++++++-------- src/dev/rsems/treesize/s/Test.scala | 94 ++++++++++++++++---------------- 7 files changed, 132 insertions(+), 98 deletions(-) diff --git a/.classpath b/.classpath index 541d5b4..fe2d5f8 100755 --- a/.classpath +++ b/.classpath @@ -1,11 +1,7 @@ - - - - - - - - - - - + + + + + + + diff --git a/.project b/.project index bd10b60..7debf88 100755 --- a/.project +++ b/.project @@ -12,7 +12,6 @@ - org.scala-ide.sdt.core.scalanature org.eclipse.jdt.core.javanature diff --git a/README.md b/README.md index 1ac7514..57cae7a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# treesize - -Rudimentäre Quick-and-dirty-Implementation des tree-Kommandos (Linux), einmal in Java und einmal in Scala - -* 16-Oct-2019 Erstellt und in svn-Repo hochgeladen -* 02-Jun-2022 Mit git2svn in lokales git-Repo migriert und in selbstgehosteten Gitea-Server gepusht -___ +# treesize + +Rudimentäre Quick-and-dirty-Implementation des tree-Kommandos (Linux), einmal in Java und einmal in Scala + +* 16-Oct-2019 Erstellt und in svn-Repo hochgeladen +* 02-Jun-2022 Mit git2svn in lokales git-Repo migriert und in selbstgehosteten Gitea-Server gepusht +___ RS 02-Jun-2022 \ No newline at end of file diff --git a/src/dev/rsems/treesize/j/Directory.java b/src/dev/rsems/treesize/j/Directory.java index 0da3f82..874b490 100755 --- a/src/dev/rsems/treesize/j/Directory.java +++ b/src/dev/rsems/treesize/j/Directory.java @@ -14,11 +14,12 @@ public class Directory { Long localSize; Long totalSize; List children; + File[] files = null; public Directory(Directory parent, File fsdir) { this.parent = parent; this.fsdir = fsdir; - File[] files = fsdir.listFiles(new FileFilter() { + files = fsdir.listFiles(new FileFilter() { @Override public boolean accept(File f) { return f.isFile() && !Files.isSymbolicLink(f.toPath()); diff --git a/src/dev/rsems/treesize/j/Test.java b/src/dev/rsems/treesize/j/Test.java index e22e7e3..6ba99ae 100755 --- a/src/dev/rsems/treesize/j/Test.java +++ b/src/dev/rsems/treesize/j/Test.java @@ -5,6 +5,11 @@ import java.io.IOException; import java.util.List; public class Test { + // + private static String CORNER = " └── "; + private static String BLANK = " "; + private static String JUNCTION = " ├── "; + private static String LINE = " │ "; static void recurse(Directory d, int level) { List subs = d.children; @@ -12,22 +17,21 @@ public class Test { Directory child = subs.get(i); Long ts = child.totalSize; if (true) /* (ts >= 100000000L) */ { - StringBuilder sb = new StringBuilder(String.format("%,16d ", ts)); + StringBuilder sb = new StringBuilder(String.format("D %,16d ", ts)); String s = ""; Directory temp = child; int loop = 0; while (temp.parent != null) { - /* ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ */ if (temp.parent.children.indexOf(temp) == temp.parent.children.size() - 1) { if (loop == 0) { - s = " └── " + s; + s = CORNER + s; } else { - s = " " + s; + s = BLANK + s; } } else if (loop == 0) { - s = " ├── " + s; + s = JUNCTION + s; } else { - s = " │ " + s; + s = LINE + s; } temp = temp.parent; loop++; @@ -35,13 +39,47 @@ public class Test { sb.append(s).append(child.fsdir.getName()); System.out.println(sb.toString()); } - if (level <= 4) recurse(child, level + 1); + + /* if (level <= 4) */ + + recurse(child, level + 1); + + int j = 0; + for (File f : child.files) { + Long fs = f.length(); + StringBuilder sb = new StringBuilder(String.format(" %,16d ", fs)); + String s = ""; + Directory temp = child; + int loop = 0; + while (temp.parent != null) { + if (temp.parent.children.indexOf(temp) == temp.parent.children.size() - 1) { + s = BLANK + s; + } else if (loop == 0) { + s = JUNCTION + s; + } else { + s = LINE + s; + } + temp = temp.parent; + loop++; + } + if (j == child.files.length - 1) { + s = s + CORNER; + } else { + s = s + JUNCTION; + } + sb.append(s).append(f.getName()); + System.out.println(sb.toString()); + j++; + } } } public static void main(String[] args) throws IOException { - Directory d = new Directory(null, new File("/home/rob")); - String s = String.format("%,16d", d.totalSize) + " " + d.fsdir.getCanonicalPath(); + String parm = args.length > 0 ? args[0] : "."; + File dir = new File(parm); +// System.out.println(dir.getCanonicalPath() + "\n"); + Directory d = new Directory(null, dir); + String s = String.format("D %,16d", d.totalSize) + " " + d.fsdir.getCanonicalPath(); System.out.println(s); recurse(d, 1); } diff --git a/src/dev/rsems/treesize/s/Directory.scala b/src/dev/rsems/treesize/s/Directory.scala index 6741af8..fc434d3 100755 --- a/src/dev/rsems/treesize/s/Directory.scala +++ b/src/dev/rsems/treesize/s/Directory.scala @@ -1,23 +1,23 @@ -package dev.rsems.treesize.s - -import java.io.File -import java.nio.file.Files -import scala.collection.mutable.ListBuffer - -class Directory(val fsdir: File, val parent: Directory = null, val sort: Boolean = false) { - private var localSize = 0L - var children = ListBuffer[Directory]() - private val files = fsdir.listFiles - if (files != null) - localSize = files.filter(f => f.isFile() && !Files.isSymbolicLink(f.toPath)).map(f => f.length).sum - var totalSize = localSize - private val dirs = fsdir.listFiles - if (dirs != null) { - totalSize += dirs.filter(f => f.isDirectory() && !Files.isSymbolicLink(f.toPath)).map(dir => { - val subdir = new Directory(dir, this, sort) - children += subdir - subdir.totalSize - }).sum - if (sort) children = children.sortBy(-_.totalSize) - } +package dev.rsems.treesize.s + +import java.io.File +import java.nio.file.Files +import scala.collection.mutable.ListBuffer + +class Directory(val fsdir: File, val parent: Directory = null, val sort: Boolean = false) { + private var localSize = 0L + var children = ListBuffer[Directory]() + private val files = fsdir.listFiles + if (files != null) + localSize = files.filter(f => f.isFile() && !Files.isSymbolicLink(f.toPath)).map(f => f.length).sum + var totalSize = localSize + private val dirs = fsdir.listFiles + if (dirs != null) { + totalSize += dirs.filter(f => f.isDirectory() && !Files.isSymbolicLink(f.toPath)).map(dir => { + val subdir = new Directory(dir, this, sort) + children += subdir + subdir.totalSize + }).sum + if (sort) children = children.sortBy(-_.totalSize) + } } \ No newline at end of file diff --git a/src/dev/rsems/treesize/s/Test.scala b/src/dev/rsems/treesize/s/Test.scala index 4dbf534..21feda3 100755 --- a/src/dev/rsems/treesize/s/Test.scala +++ b/src/dev/rsems/treesize/s/Test.scala @@ -1,48 +1,48 @@ -package dev.rsems.treesize.s - -import java.io.File - -object Test extends App { - // ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ - val LineUpAndRight = " \u2514\u2500\u2500 "; // " └── " - val LineBlank = " "; - val LineVerticalAndRight = " \u251c\u2500\u2500 "; // " ├── " - val LineVertical = " \u2502 "; // " │ " - - def recurse(d: Directory, level: Int) { - for (child <- d.children) { - val ts = child.totalSize - val sb = new StringBuilder("%,16d ".format(ts)) - var s = "" - var temp = child - var loop = 0 - while (temp.parent != null) { - if (temp.parent.children.indexOf(temp) == temp.parent.children.size - 1) { - if (loop == 0) { - s = "└─ " + s - } else { - s = " " + s - } - } else if (loop == 0) { - s = "├─ " + s - } else { - s = "│ " + s - } - temp = temp.parent - loop += 1 - } - sb.append(s).append(child.fsdir.getName) - println(sb.toString) - - // if (level <= 4) - - recurse(child, level + 1) - - } - } - - val dir = new Directory(new File("/home/rob")) - val s = "%,16d".format(dir.totalSize) + " " + dir.fsdir.getCanonicalPath - println(s) - recurse(dir, 1) +package dev.rsems.treesize.s + +import java.io.File + +object Test extends App { + // ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ + val LineUpAndRight = " \u2514\u2500\u2500 "; // " └── " + val LineBlank = " "; + val LineVerticalAndRight = " \u251c\u2500\u2500 "; // " ├── " + val LineVertical = " \u2502 "; // " │ " + + def recurse(d: Directory, level: Int) { + for (child <- d.children) { + val ts = child.totalSize + val sb = new StringBuilder("%,16d ".format(ts)) + var s = "" + var temp = child + var loop = 0 + while (temp.parent != null) { + if (temp.parent.children.indexOf(temp) == temp.parent.children.size - 1) { + if (loop == 0) { + s = "└─ " + s + } else { + s = " " + s + } + } else if (loop == 0) { + s = "├─ " + s + } else { + s = "│ " + s + } + temp = temp.parent + loop += 1 + } + sb.append(s).append(child.fsdir.getName) + println(sb.toString) + + // if (level <= 4) + + recurse(child, level + 1) + + } + } + + val dir = new Directory(new File("/home/rob")) + val s = "%,16d".format(dir.totalSize) + " " + dir.fsdir.getCanonicalPath + println(s) + recurse(dir, 1) } \ No newline at end of file From f7a0feee066bc737c110055d41a456b5d01ce2a6 Mon Sep 17 00:00:00 2001 From: Schroeder Date: Tue, 16 Aug 2022 22:20:54 +0200 Subject: [PATCH 11/13] Fixed build path --- .project | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.project b/.project index 7debf88..d46c727 100755 --- a/.project +++ b/.project @@ -5,11 +5,6 @@ - - org.scala-ide.sdt.core.scalabuilder - - - org.eclipse.jdt.core.javanature From 7fa3b3ff826b45406af2317ec37d9316bd8dc0ab Mon Sep 17 00:00:00 2001 From: Schroeder Date: Tue, 16 Aug 2022 22:38:56 +0200 Subject: [PATCH 12/13] Imported to IntelliJ IDEA --- .idea/.gitignore | 8 ++ .idea/codeStyles/Project.xml | 179 +++++++++++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/inspectionProfiles/Project_Default.xml | 12 ++ .idea/markdown.xml | 9 ++ .idea/misc.xml | 9 ++ .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 + treesize.iml | 11 ++ 9 files changed, 247 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/markdown.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 treesize.iml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..d2b0fa3 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..09dbac8 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/.idea/markdown.xml b/.idea/markdown.xml new file mode 100644 index 0000000..1e34094 --- /dev/null +++ b/.idea/markdown.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..368bc7b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..b5900ed --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/treesize.iml b/treesize.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/treesize.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file From b0cbd6fe49c644d0e95b376d203ea16487398df2 Mon Sep 17 00:00:00 2001 From: Schroeder Date: Tue, 16 Aug 2022 22:49:21 +0200 Subject: [PATCH 13/13] Scala: changed Test to use current dir --- src/dev/rsems/treesize/j/Test.java | 10 +++++----- src/dev/rsems/treesize/s/Test.scala | 2 +- treesize.iml | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/dev/rsems/treesize/j/Test.java b/src/dev/rsems/treesize/j/Test.java index 6ba99ae..cfab0c4 100755 --- a/src/dev/rsems/treesize/j/Test.java +++ b/src/dev/rsems/treesize/j/Test.java @@ -6,10 +6,10 @@ import java.util.List; public class Test { // - private static String CORNER = " └── "; - private static String BLANK = " "; - private static String JUNCTION = " ├── "; - private static String LINE = " │ "; + private static String CORNER = "└── "; + private static String BLANK = " "; + private static String JUNCTION = "├── "; + private static String LINE = "│ "; static void recurse(Directory d, int level) { List subs = d.children; @@ -24,7 +24,7 @@ public class Test { while (temp.parent != null) { if (temp.parent.children.indexOf(temp) == temp.parent.children.size() - 1) { if (loop == 0) { - s = CORNER + s; + s = CORNER + s; } else { s = BLANK + s; } diff --git a/src/dev/rsems/treesize/s/Test.scala b/src/dev/rsems/treesize/s/Test.scala index 21feda3..4b79345 100755 --- a/src/dev/rsems/treesize/s/Test.scala +++ b/src/dev/rsems/treesize/s/Test.scala @@ -41,7 +41,7 @@ object Test extends App { } } - val dir = new Directory(new File("/home/rob")) + val dir = new Directory(new File(if (args.length > 0) args(0) else ".")) val s = "%,16d".format(dir.totalSize) + " " + dir.fsdir.getCanonicalPath println(s) recurse(dir, 1) diff --git a/treesize.iml b/treesize.iml index c90834f..84c31ac 100644 --- a/treesize.iml +++ b/treesize.iml @@ -7,5 +7,6 @@ + \ No newline at end of file