Iterates for each entry in the /etc/passwd
file if a block is given.
If no block is given, returns the Enumerator
.
The code block is passed an Passwd
struct.
See Etc.getpwent
above for details.
Example:
require 'etc' Etc::Passwd.each {|u| puts u.name + " = " + u.gecos } Etc::Passwd.collect {|u| u.gecos} Etc::Passwd.collect {|u| u.gecos}
Iterates for each entry in the /etc/group
file if a block is given.
If no block is given, returns the Enumerator
.
The code block is passed a Group
struct.
Example:
require 'etc' Etc::Group.each {|g| puts g.name + ": " + g.mem.join(', ') } Etc::Group.collect {|g| g.name} Etc::Group.select {|g| !g.mem.empty?}
Get the address as an Integer
for the function named name
.
Get the address as an Integer
for the function named name
.
Returns the address as an Integer
from any handlers with the function named symbol
.
Raises a DLError
if the handle is closed.
Retrieves the section and its pairs for the current configuration.
config.each do |section, key, value| # ... end
Returns the internal Syslog
object that is initialized when the first instance is created.
Specifies the internal Syslog
object to be used.
Returns help string of OLE method. If the help string is not found, then the method returns nil.
tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser') method = WIN32OLE_METHOD.new(tobj, 'Navigate') puts method.helpstring # => Navigates to a URL or file.
Returns help string.
tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser') puts tobj.helpstring # => Web Browser interface
Inputs string
into the end of input buffer and skips data until a full flush point can be found. If the point is found in the buffer, this method flushes the buffer and returns false. Otherwise it returns true
and the following data of full flush point is preserved in the buffer.
Same as IO#sync
Same as IO
. If flag is true
, the associated IO
object must respond to the flush
method. While sync
mode is true
, the compression ratio decreases sharply.
See Zlib::GzipReader
documentation for a description.
See Zlib::GzipReader
documentation for a description.
Returns true
if stat is a symbolic link, false
if it isn’t or if the operating system doesn’t support this feature. As File::stat
automatically follows symbolic links, symlink?
will always be false
for an object returned by File::stat
.
File.symlink("testfile", "alink") #=> 0 File.stat("alink").symlink? #=> false File.lstat("alink").symlink? #=> true
Returns true
if the file is a character device, false
if it isn’t or if the operating system doesn’t support this feature.
File.stat("/dev/tty").chardev? #=> true
Iterates over keys and objects in a weakly referenced object
Iterates over the buffer, yielding each value
of data_type
starting from offset
.
If count
is given, only count
values will be yielded.
Example:
IO::Buffer.for("Hello World").each(:U8, 2, 2) do |offset, value| puts "#{offset}: #{value}" end # 2: 108 # 3: 108