Skip to content
Snippets Groups Projects
Commit 23d36a63 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix delfiles() to delete files starting with '.' (that match the pattern)

glob() by default, doesn't include 'dot files', so include the GLOB_PERIOD
flag so that when deleting all files in a directory (e.g. node1/temp/*), any
files starting with a dot will be deleted too.
parent d5881f9b
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -757,7 +757,7 @@ long delfiles(const char *inpath, const char *spec, size_t keep)
else
strcpy(path,inpath);
strcat(path,spec);
glob(path,0,NULL,&g);
glob(path, GLOB_PERIOD, NULL, &g);
free(path);
if(keep >= g.gl_pathc)
return 0;
......
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