U:RDoc::AnyMethod[iI" read:ETI"ARGF#read;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [ I"IReads _length_ bytes from ARGF. The files named on the command line ;TI"Kare concatenated and treated as a single file by this method, so when ;TI"Ocalled without arguments the contents of this pseudo file are returned in ;TI"their entirety.;To:RDoc::Markup::BlankLineo; ; [I"6_length_ must be a non-negative integer or +nil+.;T@o; ; [ I"=If _length_ is a positive integer, +read+ tries to read ;TI":_length_ bytes without any conversion (binary mode). ;TI"LIt returns +nil+ if an EOF is encountered before anything can be read. ;TI"LFewer than _length_ bytes are returned if an EOF is encountered during ;TI"the read. ;TI"HIn the case of an integer _length_, the resulting string is always ;TI"in ASCII-8BIT encoding.;T@o; ; [I""").;T@o; ; [ I"3If the optional _outbuf_ argument is present, ;TI">it must reference a String, which will receive the data. ;TI"LThe _outbuf_ will contain only the received data after the method call ;TI".even if it is not empty at the beginning.;T@o; ; [I"For example:;T@o:RDoc::Markup::Verbatim; [ I" $ echo "small" > small.txt ;TI" $ echo "large" > large.txt ;TI"&$ ./glark.rb small.txt large.txt ;TI" ;TI"'ARGF.read #=> "small\nlarge" ;TI"'ARGF.read(200) #=> "small\nlarge" ;TI"ARGF.read(2) #=> "sm" ;TI"ARGF.read(0) #=> "" ;T: @format0o; ; [ I"CNote that this method behaves like the fread() function in C. ;TI"GThis means it retries to invoke read(2) system calls to read data ;TI" with the specified length. ;TI"AIf you need the behavior like a single read(2) system call, ;TI"5consider ARGF#readpartial or ARGF#read_nonblock.;T: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"AARGF.read([length [, outbuf]]) -> string, outbuf, or nil ;T0[I"(p1 = v1, p2 = v2);T@@FI" ARGF;TcRDoc::NormalClass00