Skip to content

Commit

Permalink
File.h: Implement fs::error::xdev
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Jul 21, 2023
1 parent 465da51 commit 9291e27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Utilities/File.cpp
Expand Up @@ -130,6 +130,7 @@ static fs::error to_error(DWORD e)
case ERROR_NOT_READY: return fs::error::noent;
case ERROR_FILENAME_EXCED_RANGE: return fs::error::toolong;
case ERROR_DISK_FULL: return fs::error::nospace;
case ERROR_NOT_SAME_DEVICE: return fs::error::xdev;
default: return fs::error::unknown;
}
}
Expand Down Expand Up @@ -172,6 +173,7 @@ static fs::error to_error(int e)
case EROFS: return fs::error::readonly;
case EISDIR: return fs::error::isdir;
case ENOSPC: return fs::error::nospace;
case EXDEV: return fs::error::xdev;
default: return fs::error::unknown;
}
}
Expand Down Expand Up @@ -2360,6 +2362,7 @@ void fmt_class_string<fs::error>::format(std::string& out, u64 arg)
case fs::error::isdir: return "Is a directory";
case fs::error::toolong: return "Path too long";
case fs::error::nospace: return "Not enough space on the device";
case fs::error::xdev: return "Device mismatch";
case fs::error::unknown: return "Unknown system error";
}

Expand Down
1 change: 1 addition & 0 deletions Utilities/File.h
Expand Up @@ -704,6 +704,7 @@ namespace fs
isdir,
toolong,
nospace,
xdev,
unknown
};

Expand Down

0 comments on commit 9291e27

Please sign in to comment.