Returns original filename recorded in the gzip file header, or nil
if original filename is not present.
Specify the original name (str
) in the gzip header.
Returns true
if stat is writable by the real user id of this process.
File.stat("testfile").writable_real? #=> true
If stat is writable by others, returns an integer representing the file permission bits of stat. Returns nil
otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2)
.
m = File.stat("/tmp").world_writable? #=> 511 sprintf("%o", m) #=> "777"
Read a chunk or all of the buffer into a string, in the specified encoding
. If no encoding is provided Encoding::BINARY
is used.
buffer = IO::Buffer.for('test') buffer.get_string # => "test" buffer.get_string(2) # => "st" buffer.get_string(2, 1) # => "s"
Efficiently copy data from a source String
into the buffer, at offset
using memcpy
.
buf = IO::Buffer.new(8) # => # #<IO::Buffer 0x0000557412714a20+8 INTERNAL> # 0x00000000 00 00 00 00 00 00 00 00 ........ # set data starting from offset 1, take 2 bytes starting from string's # second buf.set_string('test', 1, 2, 1) # => 2 buf # => # #<IO::Buffer 0x0000557412714a20+8 INTERNAL> # 0x00000000 00 65 73 00 00 00 00 00 .es.....
See also copy
for examples of how buffer writing might be used for changing associated strings and files.
It returns recorded script lines if it is availalble. The script lines are not limited to the iseq range, but are entire lines of the source file.
Note that this is an API for ruby internal use, debugging, and research. Do not use this for any other purpose. The compatibility is not guaranteed.
Has a method been included in the list of insecure methods?
Like Net::HTTP.get
, but writes the returned body to $stdout; returns nil
.
Sets the maximum number of times to retry an idempotent request in case of Net::ReadTimeout
, IOError
, EOFError
, Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE, OpenSSL::SSL::SSLError
, Timeout::Error
. The initial value is 1.
Argument retries
must be a non-negative numeric value:
http = Net::HTTP.new(hostname) http.max_retries = 2 # => 2 http.max_retries # => 2
Sets the write timeout, in seconds, for self
to integer sec
; the initial value is 60.
Argument sec
must be a non-negative numeric value.
for debug