ruby-changes:25386
From: zzak <ko1@a...>
Date: Sat, 3 Nov 2012 13:28:06 +0900 (JST)
Subject: [ruby-changes:25386] zzak:r37443 (trunk): * io.c (IO#new):
zzak 2012-11-03 13:27:56 +0900 (Sat, 03 Nov 2012) New Revision: 37443 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37443 Log: * io.c (IO#new): Documentation for IO#open modes and formatting [ruby-core#48052] [Bug #7179] Modified files: trunk/io.c Index: io.c =================================================================== --- io.c (revision 37442) +++ io.c (revision 37443) @@ -6962,32 +6962,33 @@ * * Ruby allows the following open modes: * - * "r" :: Read-only, starts at beginning of file (default mode). + * "r" Read-only, starts at beginning of file (default mode). * - * "r+" :: Read-write, starts at beginning of file. + * "r+" Read-write, starts at beginning of file. * - * "w" :: Write-only, truncates existing file - * to zero length or creates a new file for writing. + * "w" Write-only, truncates existing file + * to zero length or creates a new file for writing. * - * "w+" :: Read-write, truncates existing file to zero length - * or creates a new file for reading and writing. + * "w+" Read-write, truncates existing file to zero length + * or creates a new file for reading and writing. * - * "a" :: Write-only, starts at end of file if file exists, - * otherwise creates a new file for writing. + * "a" Write-only, starts at end of file if file exists, + * otherwise creates a new file for writing. * - * "a+" :: Read-write, starts at end of file if file exists, - * otherwise creates a new file for reading and - * writing. + * "a+" Read-write, starts at end of file if file exists, + * otherwise creates a new file for reading and + * writing. * - * "b" :: Binary file mode (may appear with - * any of the key letters listed above). - * Suppresses EOL <-> CRLF conversion on Windows. And - * sets external encoding to ASCII-8BIT unless explicitly - * specified. + * The following modes must be used separately, and along with one or more of + * the modes seen above. * - * "t" :: Text file mode (may appear with - * any of the key letters listed above except "b"). + * "b" Binary file mode + * Suppresses EOL <-> CRLF conversion on Windows. And + * sets external encoding to ASCII-8BIT unless explicitly + * specified. * + * "t" Text file mode + * * When the open mode of original IO is read only, the mode cannot be * changed to be writable. Similarly, the open mode cannot be changed from * write only to readable. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/