From 3b577fbf3ad12656c0d96177d0a3012082810d51 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Fri, 7 Dec 2018 15:33:06 +0100 Subject: [PATCH] - file-tool: added option to show sub directory content --- examples/iec61850_client_example_files/file-tool.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/iec61850_client_example_files/file-tool.c b/examples/iec61850_client_example_files/file-tool.c index 396e8bf9..52680c44 100644 --- a/examples/iec61850_client_example_files/file-tool.c +++ b/examples/iec61850_client_example_files/file-tool.c @@ -118,6 +118,7 @@ printHelp() printf(" -p portnumber\n"); printf(" Operations\n"); printf(" dir - show directory\n"); + printf(" subdir - show sub directory\n"); printf(" info - show file info\n"); printf(" del - delete file\n"); printf(" get - get file\n"); @@ -146,6 +147,10 @@ parseOptions(int argc, char** argv) else if (strcmp(argv[currentArgc], "dir") == 0) { operation = FileOperationType_Dir; } + else if (strcmp(argv[currentArgc], "subdir") == 0) { + operation = FileOperationType_Dir; + filename = argv[++currentArgc]; + } else if (strcmp(argv[currentArgc], "info") == 0) { operation = FileOperationType_Info; filename = argv[++currentArgc]; @@ -176,7 +181,7 @@ showDirectory(IedConnection con) /* Get the root directory */ LinkedList rootDirectory = - IedConnection_getFileDirectory(con, &error, NULL); + IedConnection_getFileDirectory(con, &error, filename); if (error != IED_ERROR_OK) { printf("Error retrieving file directory\n");