authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-05-04 13:35:02+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-05-05 15:08:52+02:00
logb8112b3d17c678456fa19d600aeaf78c787ca8bc
tree938615d4c4cca47fa35c4ef9a38d031711150d81
parent8bce1b6981d5ec71100823dfd135402a32d9609b

Simplify File constructors


1 files changed, 2 insertions(+), 10 deletions(-)

lib/std/fs.zig+2-10
...@@ -604,11 +604,7 @@ pub const Dir = struct {...@@ -604,11 +604,7 @@ pub const Dir = struct {
604604
605 const fd = try os.openatWasi(self.fd, sub_path, 0x0, fdflags, rights);605 const fd = try os.openatWasi(self.fd, sub_path, 0x0, fdflags, rights);
606606
607 return File{607 return File{ .handle = fd };
608 .handle = fd,
609 .io_mode = .blocking,
610 .async_block_allowed = File.async_block_allowed_no,
611 };
612 }608 }
613609
614 pub const openFileC = @compileError("deprecated: renamed to openFileZ");610 pub const openFileC = @compileError("deprecated: renamed to openFileZ");
...@@ -719,11 +715,7 @@ pub const Dir = struct {...@@ -719,11 +715,7 @@ pub const Dir = struct {
719715
720 const fd = try os.openatWasi(self.fd, sub_path, oflags, 0x0, rights);716 const fd = try os.openatWasi(self.fd, sub_path, oflags, 0x0, rights);
721717
722 return File{718 return File{ .handle = fd };
723 .handle = fd,
724 .io_mode = .blocking,
725 .async_block_allowed = File.async_block_allowed_no,
726 };
727 }719 }
728720
729 /// Same as `createFile` but the path parameter is null-terminated.721 /// Same as `createFile` but the path parameter is null-terminated.