From: "mame (Yusuke Endoh)" Date: 2022-06-10T05:23:47+00:00 Subject: [ruby-core:108841] [Ruby master Bug#9431] In windows ruby IO.write returns count of bytes without count of CR character Issue #9431 has been updated by mame (Yusuke Endoh). Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN) Status changed from Open to Rejected I believe this is a spec of Windows. Ruby's IO interface is based on C's stdio, and I confirmed that `fwrite("Hello\n", 1, 6, fp)` returns 6 and actually outputs 7 bytes on Windows with cl.exe. ---------------------------------------- Bug #9431: In windows ruby IO.write returns count of bytes without count of CR character https://bugs.ruby-lang.org/issues/9431#change-97919 * Author: bdimych (Dmitry Bolshakov) * Status: Rejected * Priority: Normal * ruby -v: ruby 2.0.0p247 (2013-06-27) [i386-mingw32] ---------------------------------------- C:\Users\bdimych>ruby -e "p IO.write('temp.txt', %Q(123\n)); p File.size('temp.txt')" 4 5 imho it looks unexpected -- https://bugs.ruby-lang.org/ Unsubscribe: