00001
00002 #include <unistd.h>
00003 #include <string.h>
00004 #include <stdio.h>
00005 #include <stdlib.h>
00006 #include "benchmarkshelper.h"
00007
00008
00009
00010
00011
00012
00013 void dirOK(char *sDir)
00014 {
00015 char sLoc[256], fileNameLoc[1024];
00016 if (strlen(sDir) > 1024)
00017 ERROR("pathName too long %s\n",sDir);
00018 sprintf(sLoc, "test -d %s", sDir);
00019 if ( system(sLoc) )
00020 {
00021 sprintf(sLoc, "mkdir %s", sDir);
00022 system(sLoc);
00023 }
00024
00025 sprintf(sLoc, "test -d %s", sDir);
00026 if ( system(sLoc) )
00027 ERROR("Failed to create dir %s", sDir);
00028
00029 createFullFileName(fileNameLoc, sDir, (char*)"toto");
00030 sprintf(sLoc, "touch %s", fileNameLoc);
00031 if ( system(sLoc) )
00032 ERROR("Problem writing in dir %s", sDir);
00033 else
00034 unlink(fileNameLoc);
00035 return;
00036 }