This commit is contained in:
dave caruso
2024-03-11 19:03:46 -07:00
parent 5b8653aaec
commit aa1c989911
2 changed files with 8 additions and 3 deletions

View File

@@ -1024,6 +1024,11 @@ pub fn openA(file_path: []const u8, flags: bun.Mode, perm: bun.Mode) Maybe(bun.F
}
pub fn open(file_path: [:0]const u8, flags: bun.Mode, perm: bun.Mode) Maybe(bun.FileDescriptor) {
// TODO(@paperdave): this should not need to use libuv
if (comptime Environment.isWindows) {
return sys_uv.open(file_path, flags, perm);
}
// this is what open() does anyway.
return openat(bun.toFD((std.fs.cwd().fd)), file_path, flags, perm);
}

View File

@@ -2159,7 +2159,7 @@ describe("fs/promises", () => {
});
});
it("stat on a large file", () => {
it("fstat on a large file", () => {
var dest: string = "",
fd;
try {
@@ -2171,13 +2171,13 @@ it("stat on a large file", () => {
while (offset < 5 * 1024 * 1024 * 1024) {
offset += writeSync(fd, bigBuffer, 0, bigBuffer.length, offset);
}
fdatasyncSync(fd);
expect(fstatSync(fd).size).toEqual(offset);
} finally {
if (fd) closeSync(fd);
unlinkSync(dest);
}
});
}, 20_000);
it("fs.constants", () => {
if (isWindows) {