internal static void ReportWarning(BinaryOpStorage /*!*/ writeStorage, ConversionStorage <MutableString> /*!*/ tosConversion, object message) { if (writeStorage.Context.Verbose != null) { var output = writeStorage.Context.StandardErrorOutput; // MRI: unlike Kernel#puts this outputs \n even if the message ends with \n: var site = writeStorage.GetCallSite("write", 1); site.Target(site, output, PrintOps.ToPrintedString(tosConversion, message)); PrintOps.PutsEmptyLine(writeStorage, output); } }
public static int SysWrite(BinaryOpStorage /*!*/ writeStorage, ConversionStorage <MutableString> /*!*/ tosConversion, RubyContext /*!*/ context, RubyIO /*!*/ self, [NotNull] MutableString /*!*/ val) { RubyBufferedStream stream = self.GetWritableStream(); if (stream.DataBuffered) { PrintOps.ReportWarning(writeStorage, tosConversion, MutableString.CreateAscii("syswrite for buffered IO")); } int bytes = Write(self, val); self.Flush(); return(bytes); }