Message414220
The REMOVE_DIR case reduces to
return RemoveDirectoryW(path->wide) ? 0 : -1;
so I think there's no reason to combine it with the other two.
The REMOVE_BOTH case is
attrs = GetFileAttributesW(path->wide);
if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY)) {
success = RemoveDirectoryW(path->wide);
} else {
success = DeleteFileW(path->wide);
}
return success ? 0 : -1;
For REMOVE_BOTH, I don't see the need of calling GetFileAttributes - couldn't you just try DeleteFile, and if that fails, RemoveDirectory? |
|
Date |
User |
Action |
Args |
2022-02-28 19:59:50 | benrg | set | recipients:
+ benrg, eryksun, bup |
2022-02-28 19:59:50 | benrg | set | messageid: <1646078390.72.0.0100923337547.issue46791@roundup.psfhosted.org> |
2022-02-28 19:59:50 | benrg | link | issue46791 messages |
2022-02-28 19:59:50 | benrg | create | |
|