Skip to content
Snippets Groups Projects
Commit 0e39d4f1 authored by Michal Svamberg's avatar Michal Svamberg
Browse files

Fix counting

parent 1681377b
Branches master
No related tags found
No related merge requests found
Pipeline #3413 failed
......@@ -4,7 +4,7 @@ import 'package:dufc/dufc.dart';
int main(List<String> arguments) {
int count = 0;
final dir = Directory(arguments[0]);
count = dirContents(dir, "");
count = dirContents(dir, "") + 1;
print("Total (${arguments[0]}): $count");
exit(0);
......
......@@ -14,8 +14,9 @@ int dirContents(Directory dir, String prefix) {
if (entity is Directory) {
//print("$prefix $pipe-- ${entity.name}");
subCount = dirContents(entity, "$prefix$pipe ");
count = count + subCount;
}
count = count + subCount + 1;
count++;
//stdout.write(prefix);
if (entity is Directory) {
print("$prefix$pipe-+- ${entity.name} (${entity.path}) $subCount");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment