| author | |
| committer | |
| log | e078324dbe2b57a4016d91b2d2cca0bfc3ef82aa |
| tree | 4c5d9fe7120500bc8a27f59e62a1d6c622b3509a |
| parent | 84b4b6bffa126f1491f6029286ddecb5d6aec74b |
This matches how other filesystem functions were made to handle BAD_NETWORK_PATH/BAD_NETWORK_NAME in https://github.com/ziglang/zig/pull/16568. ReadLink was the odd one out, but that is no longer the case.3 files changed, 6 insertions(+), 3 deletions(-)
lib/std/os.zig+2| ... | ... | @@ -2995,6 +2995,8 @@ pub const ReadLinkError = error{ |
| 2995 | 2995 | /// Windows-only. This error may occur if the opened reparse point is |
| 2996 | 2996 | /// of unsupported type. |
| 2997 | 2997 | UnsupportedReparsePointType, |
| 2998 | /// On Windows, `\\server` or `\\server\share` was not found. | |
| 2999 | NetworkNotFound, | |
| 2998 | 3000 | } || UnexpectedError; |
| 2999 | 3001 | |
| 3000 | 3002 | /// Read value of a symbolic link. |
lib/std/os/windows.zig+3-3| ... | ... | @@ -803,6 +803,7 @@ pub fn CreateSymbolicLink( |
| 803 | 803 | |
| 804 | 804 | pub const ReadLinkError = error{ |
| 805 | 805 | FileNotFound, |
| 806 | NetworkNotFound, | |
| 806 | 807 | AccessDenied, |
| 807 | 808 | Unexpected, |
| 808 | 809 | NameTooLong, |
| ... | ... | @@ -850,9 +851,8 @@ pub fn ReadLink(dir: ?HANDLE, sub_path_w: []const u16, out_buffer: []u8) ReadLin |
| 850 | 851 | .OBJECT_NAME_NOT_FOUND => return error.FileNotFound, |
| 851 | 852 | .OBJECT_PATH_NOT_FOUND => return error.FileNotFound, |
| 852 | 853 | .NO_MEDIA_IN_DEVICE => return error.FileNotFound, |
| 853 | // TODO: Should BAD_NETWORK_* be translated to a different error? | |
| 854 | .BAD_NETWORK_PATH => return error.FileNotFound, // \\server was not found | |
| 855 | .BAD_NETWORK_NAME => return error.FileNotFound, // \\server was found but \\server\share wasn't | |
| 854 | .BAD_NETWORK_PATH => return error.NetworkNotFound, // \\server was not found | |
| 855 | .BAD_NETWORK_NAME => return error.NetworkNotFound, // \\server was found but \\server\share wasn't | |
| 856 | 856 | .INVALID_PARAMETER => unreachable, |
| 857 | 857 | .SHARING_VIOLATION => return error.AccessDenied, |
| 858 | 858 | .ACCESS_DENIED => return error.AccessDenied, |
lib/std/zig/system/NativeTargetInfo.zig+1| ... | ... | @@ -833,6 +833,7 @@ pub fn abiAndDynamicLinkerFromFile( |
| 833 | 833 | error.InvalidUtf8 => unreachable, // Windows only |
| 834 | 834 | error.BadPathName => unreachable, // Windows only |
| 835 | 835 | error.UnsupportedReparsePointType => unreachable, // Windows only |
| 836 | error.NetworkNotFound => unreachable, // Windows only | |
| 836 | 837 | |
| 837 | 838 | error.AccessDenied, |
| 838 | 839 | error.FileNotFound, |