mirror of
https://github.com/oven-sh/bun
synced 2026-02-17 22:32:06 +00:00
yikes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user