std.os.File: add missing pub modifiers

This commit is contained in:
Andrew Kelley 2018-07-19 13:06:13 -04:00
parent a9f0681f85
commit 0736e6aa34

View File

@ -15,7 +15,7 @@ pub const File = struct {
/// The OS-specific file descriptor or file handle. /// The OS-specific file descriptor or file handle.
handle: os.FileHandle, handle: os.FileHandle,
const OpenError = os.WindowsOpenError || os.PosixOpenError; pub const OpenError = os.WindowsOpenError || os.PosixOpenError;
/// `path` needs to be copied in memory to add a null terminating byte, hence the allocator. /// `path` needs to be copied in memory to add a null terminating byte, hence the allocator.
/// Call close to clean up. /// Call close to clean up.
@ -289,7 +289,7 @@ pub const File = struct {
Unexpected, Unexpected,
}; };
fn mode(self: *File) ModeError!os.FileMode { pub fn mode(self: *File) ModeError!os.FileMode {
if (is_posix) { if (is_posix) {
var stat: posix.Stat = undefined; var stat: posix.Stat = undefined;
const err = posix.getErrno(posix.fstat(self.handle, &stat)); const err = posix.getErrno(posix.fstat(self.handle, &stat));
@ -364,7 +364,7 @@ pub const File = struct {
pub const WriteError = os.WindowsWriteError || os.PosixWriteError; pub const WriteError = os.WindowsWriteError || os.PosixWriteError;
fn write(self: *File, bytes: []const u8) WriteError!void { pub fn write(self: *File, bytes: []const u8) WriteError!void {
if (is_posix) { if (is_posix) {
try os.posixWrite(self.handle, bytes); try os.posixWrite(self.handle, bytes);
} else if (is_windows) { } else if (is_windows) {