Returns the destination address of ifaddr. nil is returned if the flags doesn’t have IFF_POINTOPOINT.
Same as IO
.
Same as IO
.
Same as IO
.
Returns true
if stat is writable by the effective user id of this process.
File.stat("testfile").writable? #=> true
Returns true
if the operating system supports pipes and stat is a pipe; false
otherwise.
Returns true
if stat has its sticky bit set, false
if it doesn’t or if the operating system doesn’t support this feature.
File.stat("testfile").sticky? #=> false
Get the URI
of the remote object.
Get the URI
of the remote object.
Wakes up all threads waiting for this lock.
Puts the connection into binary (image) mode, issues the given command, and fetches the data returned, passing it to the associated block in chunks of blocksize
characters. Note that cmd
is a server command (such as “RETR myfile”).
Puts the connection into ASCII (text) mode, issues the given command, and passes the resulting data, one line at a time, to the associated block. If no block is given, prints the lines. Note that cmd
is a server command (such as “RETR myfile”).
Puts the connection into binary (image) mode, issues the given server-side command (such as “STOR myfile”), and sends the contents of the file named file
to the server. If the optional block is given, it also passes it the data, in chunks of blocksize
characters.
Puts the connection into ASCII (text) mode, issues the given server-side command (such as “STOR myfile”), and sends the contents of the file named file
to the server, one line at a time. If the optional block is given, it also passes it the lines.
Returns an array of filenames in the remote directory.
Returns an array of file information in the directory (the output is like ‘ls -l`). If a block is given, it iterates through the listing.
Returns data (e.g., size, last modification time, entry type, etc.) about the file or directory specified by pathname
. If pathname
is omitted, the current directory is assumed.
Returns system information.
Returns the status (STAT command). pathname - when stat is invoked with pathname as a parameter it acts like
list but alot faster and over the same tcp session.
Posts data to the specified URI
object.
Example:
require 'net/http' require 'uri' Net::HTTP.post URI('http://www.example.com/api/search'), { "q" => "ruby", "max" => "50" }.to_json, "Content-Type" => "application/json"
Creates a new Net::HTTP
object, then additionally opens the TCP connection and HTTP
session.
Arguments are the following:
hostname or IP address of the server
port of the server
address of proxy
port of proxy
user of proxy
pass of proxy
optional hash
opt sets following values by its accessor. The keys are ca_file
, ca_path
, cert, cert_store
, ciphers, close_on_empty_response
, key, open_timeout
, read_timeout
, ssl_timeout
, ssl_version
, use_ssl, verify_callback
, verify_depth
and verify_mode. If you set :use_ssl as true, you can use https and default value of verify_mode
is set as OpenSSL::SSL::VERIFY_PEER.
If the optional block is given, the newly created Net::HTTP
object is passed to it and closed when the block finishes. In this case, the return value of this method is the return value of the block. If no block is given, the return value of this method is the newly created Net::HTTP
object itself, and the caller is responsible for closing it upon completion using the finish() method.
Returns true if the HTTP
session has been started.