#how do i access buffered writer from anywhere
1 messages · Page 1 of 1 (latest)
define then intialize at runtime
var hw: std.io.BufferedWriter(...) = undefined;
pub fn main() void {
hw = std.io.bufferedWriter(std.io.getStdOut().writer());
}
i can't get it to work... what type should my variable be?
supposedly the type is
io.buffered_writer.BufferedWriter(4096,io.GenericWriter(fs.File,error{DiskQuota,FileTooBig,InputOutput,NoSpaceLeft,DeviceBusy,InvalidArgument,AccessDenied,BrokenPipe,SystemResources,OperationAborted,NotOpenForWriting,LockViolation,WouldBlock,ConnectionResetByPeer,Unexpected},(function 'write')))
but i can't get that to work either
even when i try fiddling around to change some things
std.io.BufferedWriter(4096, std.fs.File.Writer)