Changeset 1589
- Timestamp:
- 2000-10-06T04:45:28+13:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsinstaller/FilePath.cpp
r1544 r1589 268 268 */ 269 269 bool FilePath::exists() 270 { 271 File f(this->path); 272 return f.exists(); 270 { OFSTRUCT of; 271 string testpath; 272 bool reply; 273 DWORD attrs; 274 275 if (this->path.length() < 5) 276 { return true; 277 } 278 if (this->path[this->path.length()-1] == '\\') 279 { testpath = this->path.substr(0, this->path.length()-1); 280 } 281 else 282 { testpath = this->path; 283 } 284 attrs = GetFileAttributes((LPCSTR) testpath.c_str()); 285 if ((attrs == 0xffffffff) || ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0)) 286 { reply = !(OpenFile((LPCSTR) testpath.c_str(), (LPOFSTRUCT) &of, OF_EXIST) == HFILE_ERROR); 287 } 288 else 289 { reply = true; 290 } 291 return reply; 273 292 } 274 293
Note:
See TracChangeset
for help on using the changeset viewer.