Changeset 80 in dev for ProjectEditor/FileOperation.cpp
- Timestamp:
- Mar 26, 2007, 6:33:06 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ProjectEditor/FileOperation.cpp
r24 r80 172 172 } 173 173 174 void RemoveDirectoryStrong(const char *dir_path){ 174 void RemoveDirectoryStrong(const char *dirPath){ 175 char tempDirPath[MAX_PATH]; 176 lstrcpy( tempDirPath, dirPath ); 177 178 if( tempDirPath[lstrlen(tempDirPath)-1] == '\\' ){ 179 tempDirPath[lstrlen(tempDirPath)-1] = 0; 180 } 181 175 182 HANDLE hFind; 176 183 WIN32_FIND_DATA wfd; 177 184 char temporary[MAX_PATH]; 178 sprintf(temporary,"%s *",dir_path);185 sprintf(temporary,"%s\\*",tempDirPath); 179 186 180 187 hFind=FindFirstFile(temporary,&wfd); … … 184 191 if(!(lstrcmp(wfd.cFileName,".")==0||lstrcmp(wfd.cFileName,"..")==0)){ 185 192 //ディレクトリのとき 186 sprintf(temporary,"%s %s\\",dir_path,wfd.cFileName);193 sprintf(temporary,"%s\\%s\\",tempDirPath,wfd.cFileName); 187 194 RemoveDirectoryStrong(temporary); 188 195 } … … 190 197 else{ 191 198 //ファイルのとき 192 sprintf(temporary,"%s %s",dir_path,wfd.cFileName);199 sprintf(temporary,"%s\\%s",tempDirPath,wfd.cFileName); 193 200 194 201 DeleteFile(temporary); 195 202 } 196 203 }while(FindNextFile(hFind,&wfd)); 197 } 198 199 RemoveDirectory(dir_path); 204 205 FindClose( hFind ); 206 } 207 208 if( !RemoveDirectory(tempDirPath) ){ 209 OutputDebugString( GetLastErrorString().c_str() ); 210 OutputDebugString( "\r\n" ); 211 OutputDebugString( "一時ディレクトリの削除に失敗\r\n" ); 212 } 200 213 } 201 214
Note:
See TracChangeset
for help on using the changeset viewer.