Skip to content

Commit

Permalink
fix: bug where os.Stat on a non-existent file would return "File exis…
Browse files Browse the repository at this point in the history
…ts" error

Signed-off-by: Harikrishnan Balagopal <[email protected]>
  • Loading branch information
HarikrishnanBalagopal committed Oct 10, 2023
1 parent 4f69fae commit f4d2382
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fs_fd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class OpenDirectory extends Fd {
): { ret: number; filestat: wasi.Filestat | null } {
const entry = this.dir.get_entry_for_path(path);
if (entry == null) {
return { ret: wasi.ERRNO_EXIST, filestat: null };
return { ret: wasi.ERRNO_NOENT, filestat: null };
}
return { ret: 0, filestat: entry.stat() };
}
Expand Down

0 comments on commit f4d2382

Please sign in to comment.