"James Hawkins" truiken@gmail.com writes:
+static void delete_cab_files(void) +{
- SHFILEOPSTRUCT shfl;
- CHAR path[MAX_PATH];
- lstrcpyA(path, CURR_DIR);
- lstrcatA(path, "\*.cab\0");
- shfl.hwnd = NULL;
- shfl.wFunc = FO_DELETE;
- shfl.pFrom = (LPCSTR)path;
- shfl.pTo = NULL;
- shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT;
- SHFileOperation(&shfl);
+}
If you are going to delete files with wildcards, you need to create a temp dir and do everything inside it, otherwise you risk deleting files that are not part of the test.