Emit a scalar with value
, anchor
, tag
, and a plain
or quoted
string type with style
.
Get the output style, canonical or not.
Set
the output style to canonical, or not.
Enter error recovering mode. This method does not call on_error
.
Exit parser. Return value is Symbol_Value_Stack.
Leave error recovering mode.
returns the timestamp as a time object.
ancillarydata should be one of following type:
SOL_SOCKET/SCM_TIMESTAMP (microsecond) GNU/Linux, FreeBSD, NetBSD, OpenBSD, Solaris, MacOS X
SOL_SOCKET/SCM_TIMESTAMPNS (nanosecond) GNU/Linux
SOL_SOCKET/SCM_BINTIME (2**(-64) second) FreeBSD
Addrinfo.udp
(“127.0.0.1”, 0).bind {|s1|
Addrinfo.udp("127.0.0.1", 0).bind {|s2| s1.setsockopt(:SOCKET, :TIMESTAMP, true) s2.send "a", 0, s1.local_address ctl = s1.recvmsg.last p ctl #=> #<Socket::AncillaryData: INET SOCKET TIMESTAMP 2009-02-24 17:35:46.775581> t = ctl.timestamp p t #=> 2009-02-24 17:35:46 +0900 p t.usec #=> 775581 p t.nsec #=> 775581000 }
}
Creates a new Socket::Option
object for SOL_SOCKET/SO_LINGER.
onoff should be an integer or a boolean.
secs should be the number of seconds.
p Socket::Option.linger(true, 10) #=> #<Socket::Option: UNSPEC SOCKET LINGER on 10sec>
Returns the linger data in sockopt as a pair of boolean and integer.
sockopt = Socket::Option.linger(true, 10) p sockopt.linger => [true, 10]
Logs a message
at the error (syslog warning) log level, or logs the message returned from the block.
Logs a message
at the warn (syslog notice) log level, or logs the message returned from the block.
Returns the adler-32 checksum.
Returns true if the stream is closed.
Closes the stream. All operations on the closed stream will raise an exception.
Resets and initializes the stream. All data in both input and output buffer are discarded.
Returns last modification time recorded in the gzip file header.
Closes the GzipFile
object. This method calls close method of the associated IO
object. Returns the associated IO
object.
Same as IO#closed?
Specify the modification time (mtime
) in the gzip header. Using an Integer
.
Setting the mtime in the gzip header does not effect the mtime of the file generated. Different utilities that expand the gzipped files may use the mtime header. For example the gunzip utility can use the ‘-N` flag which will set the resultant file’s mtime to the value in the header. By default many tools will set the mtime of the expanded file to the mtime of the gzipped file, not the mtime in the header.
If you do not set an mtime, the default value will be the time when compression started. Setting a value of 0 indicates no time stamp is available.
Opens a file specified by filename
for writing gzip compressed data, and returns a GzipWriter
object associated with that file. Further details of this method are found in Zlib::GzipWriter.new
and Zlib::GzipFile.wrap
.
Opens a file specified by filename
as a gzipped file, and returns a GzipReader
object associated with that file. Further details of this method are in Zlib::GzipReader.new
and ZLib::GzipFile.wrap.
Returns the rest of the data which had read for parsing gzip format, or nil
if the whole gzip file is not parsed yet.
See Zlib::GzipReader
documentation for a description.
Returns the last access time for this file as an object of class Time
.
File.stat("testfile").atime #=> Wed Dec 31 18:00:00 CST 1969
Returns the modification time of stat.
File.stat("testfile").mtime #=> Wed Apr 09 08:53:14 CDT 2003