| 850 | } |
| 851 | |
| 852 | Result<bool> DeleteDirContents(const PlatformFilename& dir_path, bool allow_not_found, |
| 853 | bool remove_top_dir) { |
| 854 | bool exists = true; |
| 855 | WIN32_FIND_DATAW entry; |
| 856 | if (allow_not_found) { |
| 857 | RETURN_NOT_OK(FindOneFile(dir_path, &entry, &exists)); |
| 858 | } else { |
| 859 | // Will raise if dir_path does not exist |
| 860 | RETURN_NOT_OK(FindOneFile(dir_path, &entry)); |
| 861 | } |
| 862 | if (exists) { |
| 863 | RETURN_NOT_OK(DeleteDirEntryDir(dir_path, entry, remove_top_dir)); |
| 864 | } |
| 865 | return exists; |
| 866 | } |
| 867 | |
| 868 | #else // POSIX |
| 869 | |