diff options
Diffstat (limited to 'scripts/test-shell.c')
-rw-r--r-- | scripts/test-shell.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/test-shell.c b/scripts/test-shell.c index 963d128c..9dadedcb 100644 --- a/scripts/test-shell.c +++ b/scripts/test-shell.c @@ -163,6 +163,12 @@ int run_commands(FILE *cmdstream){ ret = 1; break; } + } else if (strstr(line, "file exists ") == line) { + char const *filename = line + sizeof("file exists ") -1; + fprintf(stderr, "FILENAME: %s\n", filename); + struct stat st; + int result = stat(filename, &st); + return result != 0; } else if (strstr(line, "create file ") == line) { char const *filename = line + sizeof("create file ") -1; FILE *outfile = fopen(filename, "w"); |