Remove a directory entry that's always a directory
| 813 | |
| 814 | // Remove a directory entry that's always a directory |
| 815 | Status DeleteDirEntryDir(const PlatformFilename& path, const WIN32_FIND_DATAW& entry, |
| 816 | bool remove_top_dir = true) { |
| 817 | if ((entry.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) == 0) { |
| 818 | // It's a directory that doesn't have a reparse point => recurse |
| 819 | RETURN_NOT_OK(DeleteDirTreeInternal(path)); |
| 820 | } |
| 821 | if (remove_top_dir) { |
| 822 | // Remove now empty directory or reparse point (e.g. symlink to dir) |
| 823 | if (!RemoveDirectoryW(path.ToNative().c_str())) { |
| 824 | return IOErrorFromWinError(GetLastError(), "Cannot delete directory entry '", |
| 825 | path.ToString(), "': "); |
| 826 | } |
| 827 | } |
| 828 | return Status::OK(); |
| 829 | } |
| 830 | |
| 831 | Status DeleteDirEntry(const PlatformFilename& path, const WIN32_FIND_DATAW& entry) { |
| 832 | if ((entry.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) { |
no test coverage detected