summaryrefslogtreecommitdiff
path: root/sapi/isapi/stresstest/stresstest.cpp
diff options
context:
space:
mode:
authorShane Caraveo <shane@php.net>2001-01-15 01:13:51 +0000
committerShane Caraveo <shane@php.net>2001-01-15 01:13:51 +0000
commit1d40310fa4b91af309a2d247983dadc9a0b6c535 (patch)
tree368fae48c8bd60b90831ca629e232077dbf34a66 /sapi/isapi/stresstest/stresstest.cpp
parentfcdf6ac680c852cc894288b54df3050daa61907f (diff)
downloadphp-git-1d40310fa4b91af309a2d247983dadc9a0b6c535.tar.gz
clean up temp files
Diffstat (limited to 'sapi/isapi/stresstest/stresstest.cpp')
-rw-r--r--sapi/isapi/stresstest/stresstest.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/sapi/isapi/stresstest/stresstest.cpp b/sapi/isapi/stresstest/stresstest.cpp
index 2b5e5b8380..2324adec39 100644
--- a/sapi/isapi/stresstest/stresstest.cpp
+++ b/sapi/isapi/stresstest/stresstest.cpp
@@ -315,6 +315,25 @@ BOOL GetTestFiles(const char *path)
return IsapiFileList.GetSize() > 0;
}
+void DeleteTempFiles(const char *mask)
+{
+ char FindPath[MAX_PATH];
+ WIN32_FIND_DATA fd;
+ memset(&fd, 0, sizeof(WIN32_FIND_DATA));
+
+ _snprintf(FindPath, sizeof(FindPath)-1, "%s\\%s",temppath, mask);
+ HANDLE fh = FindFirstFile(FindPath, &fd);
+ if (fh != INVALID_HANDLE_VALUE) {
+ do {
+ char NewFindPath[MAX_PATH];
+ _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s",temppath, fd.cFileName);
+ DeleteFile(NewFindPath);
+ memset(&fd, 0, sizeof(WIN32_FIND_DATA));
+ } while (FindNextFile(fh, &fd) != 0);
+ FindClose(fh);
+ }
+}
+
void DoTestFiles(const char *filelist, const char *environment)
{
if (!GetTestFiles(filelist)) {
@@ -335,6 +354,12 @@ void DoTestFiles(const char *filelist, const char *environment)
TResults result = Results.GetAt(i);
printf("%s\r\nOK: %d FAILED: %d\r\n", TestNames.GetAt(i), result.ok, result.bad);
}
+
+ // delete temp files
+ printf("Deleting Temp Files\r\n");
+ DeleteTempFiles("exp.*");
+ DeleteTempFiles("pht.*");
+ printf("Done\r\n");
}
int main(int argc, char* argv[]) {