Returns the real (absolute) pathname for self
in the actual filesystem.
Does not contain symlinks or useless dots, ..
and .
.
All components of the pathname must exist when this method is called.
Returns the real (absolute) pathname of self
in the actual filesystem.
Does not contain symlinks or useless dots, ..
and .
.
The last component of the real pathname can be nonexistent.
See File.lstat
.
Return scanner state of current token.
Iterates over each key-value pair in the database.
If no block is given, returns an Enumerator
.
Insert or update key-value pairs.
This method will work with any object which implements an each_pair
method, such as a Hash
.
creates a new socket object connected to host:port using TCP/IP.
If local_host:local_port is given, the socket is bound to it.
The optional last argument opts is options represented by a hash. opts may have following options:
specify the timeout in seconds.
If a block is given, the block is called with the socket. The value of the block is returned. The socket is closed when this method returns.
If no block is given, the socket is returned.
Socket.tcp("www.ruby-lang.org", 80) {|sock| sock.print "GET / HTTP/1.0\r\nHost: www.ruby-lang.org\r\n\r\n" sock.close_write puts sock.read }
iterates over the list of Addrinfo
objects obtained by Addrinfo.getaddrinfo
.
Addrinfo.foreach(nil, 80) {|x| p x } #=> #<Addrinfo: 127.0.0.1:80 TCP (:80)> # #<Addrinfo: 127.0.0.1:80 UDP (:80)> # #<Addrinfo: [::1]:80 TCP (:80)> # #<Addrinfo: [::1]:80 UDP (:80)>
returns an addrinfo object for TCP address.
Addrinfo.tcp("localhost", "smtp") #=> #<Addrinfo: 127.0.0.1:25 TCP (localhost:smtp)>
Returns the path of the local address of unixsocket.
s = UNIXServer.new("/tmp/sock") p s.path #=> "/tmp/sock"
See IO#each
.
This is a deprecated alias for each_char
.
See IO#getc
.
Pushes back one character (passed as a parameter) onto strio such that a subsequent buffered read will return it. There is no limitation for multiple pushbacks including pushing back behind the beginning of the buffer string.
See IO#putc
.
Returns false
. Just for compatibility to IO
.