@@ -503,44 +503,14 @@ pub fn openSelfExe(flags: File.OpenFlags) OpenSelfExeError!File {
503
503
return openFileAbsoluteZ (buf [0.. self_exe_path .len :0 ].ptr , flags );
504
504
}
505
505
506
- // This is os.ReadLinkError || os.RealPathError with impossible errors excluded
507
- pub const SelfExePathError = error {
508
- FileNotFound ,
509
- AccessDenied ,
510
- NameTooLong ,
511
- NotSupported ,
512
- NotDir ,
513
- SymLinkLoop ,
514
- InputOutput ,
515
- FileTooBig ,
516
- IsDir ,
517
- ProcessFdQuotaExceeded ,
518
- SystemFdQuotaExceeded ,
519
- NoDevice ,
520
- SystemResources ,
521
- NoSpaceLeft ,
522
- FileSystem ,
523
- BadPathName ,
524
- DeviceBusy ,
525
- SharingViolation ,
526
- PipeBusy ,
527
- NotLink ,
528
- PathAlreadyExists ,
529
-
530
- /// On Windows, `\\server` or `\\server\share` was not found.
531
- NetworkNotFound ,
532
-
533
- /// On Windows, antivirus software is enabled by default. It can be
534
- /// disabled, but Windows Update sometimes ignores the user's preference
535
- /// and re-enables it. When enabled, antivirus software on Windows
536
- /// intercepts file system operations and makes them significantly slower
537
- /// in addition to possibly failing with this error code.
538
- AntivirusInterference ,
539
-
540
- /// On Windows, the volume does not contain a recognized file system. File
541
- /// system drivers might not be loaded, or the volume may be corrupt.
542
- UnrecognizedVolume ,
543
- } || os .SysCtlError ;
506
+ pub const SelfExePathError = std .error_set .ExcludingAssertAllContained (
507
+ os .ReadLinkError || os .RealPathError || os .SysCtlError ,
508
+ error {
509
+ UnsupportedReparsePointType , // Windows-only readlink error; readlink is not called in the Windows implementation
510
+ InvalidUtf8 , // WASI-only error; selfExePath is not supported on WASI
511
+ InvalidWtf8 , // selfExePath only converts from WTF-16 -> WTF-8 which cannot fail
512
+ },
513
+ );
544
514
545
515
/// `selfExePath` except allocates the result on the heap.
546
516
/// Caller owns returned memory.
0 commit comments