Results for: "fnmatch"

No documentation available

Checks the status of the child process specified by pid. Returns nil if the process is still alive.

If the process is not alive, and raise was true, a PTY::ChildExited exception will be raised. Otherwise it will return a Process::Status instance.

pid

The process id of the process to check

raise

If true and the process identified by pid is no longer alive a PTY::ChildExited is raised.

Returns the log priority mask in effect. The mask is not reset by opening or closing syslog.

Sets the log priority mask. A method LOG_UPTO is defined to make it easier to set mask values. Example:

Syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_ERR)

Alternatively, specific priorities can be selected and added together using binary OR. Example:

Syslog.mask = Syslog::LOG_MASK(Syslog::LOG_ERR) | Syslog::LOG_MASK(Syslog::LOG_CRIT)

The priority mask persists through calls to open() and close().

Compresses the given string. Valid values of level are Zlib::NO_COMPRESSION, Zlib::BEST_SPEED, Zlib::BEST_COMPRESSION, Zlib::DEFAULT_COMPRESSION, or an integer from 0 to 9.

This method is almost equivalent to the following code:

def deflate(string, level)
  z = Zlib::Deflate.new(level)
  dst = z.deflate(string, Zlib::FINISH)
  z.close
  dst
end

See also Zlib.inflate

Decompresses string. Raises a Zlib::NeedDict exception if a preset dictionary is needed for decompression.

This method is almost equivalent to the following code:

def inflate(string)
  zstream = Zlib::Inflate.new
  buf = zstream.inflate(string)
  zstream.finish
  zstream.close
  buf
end

See also Zlib.deflate

Returns true if filepath points to a character device, false otherwise.

File.chardev?($stdin)     # => true
File.chardev?('t.txt')     # => false

Returns a Hash containing information about the GC.

The contents of the hash are implementation specific and may change in the future without notice.

The hash includes information about internal statistics about GC such as:

count

The total number of garbage collections ran since application start (count includes both minor and major garbage collections)

time

The total time spent in garbage collections (in milliseconds)

heap_allocated_pages

The total number of ‘:heap_eden_pages` + `:heap_tomb_pages`

heap_sorted_length

The number of pages that can fit into the buffer that holds references to all pages

heap_allocatable_pages

The total number of pages the application could allocate without additional GC

heap_available_slots

The total number of slots in all ‘:heap_allocated_pages`

heap_live_slots

The total number of slots which contain live objects

heap_free_slots

The total number of slots which do not contain live objects

heap_final_slots

The total number of slots with pending finalizers to be run

heap_marked_slots

The total number of objects marked in the last GC

heap_eden_pages

The total number of pages which contain at least one live slot

heap_tomb_pages

The total number of pages which do not contain any live slots

total_allocated_pages

The cumulative number of pages allocated since application start

total_freed_pages

The cumulative number of pages freed since application start

total_allocated_objects

The cumulative number of objects allocated since application start

total_freed_objects

The cumulative number of objects freed since application start

malloc_increase_bytes

Amount of memory allocated on the heap for objects. Decreased by any GC

malloc_increase_bytes_limit

When ‘:malloc_increase_bytes` crosses this limit, GC is triggered

minor_gc_count

The total number of minor garbage collections run since process start

major_gc_count

The total number of major garbage collections run since process start

compact_count

The total number of compactions run since process start

read_barrier_faults

The total number of times the read barrier was triggered during compaction

total_moved_objects

The total number of objects compaction has moved

remembered_wb_unprotected_objects

The total number of objects without write barriers

remembered_wb_unprotected_objects_limit

When ‘:remembered_wb_unprotected_objects` crosses this limit, major GC is triggered

old_objects

Number of live, old objects which have survived at least 3 garbage collections

old_objects_limit

When ‘:old_objects` crosses this limit, major GC is triggered

oldmalloc_increase_bytes

Amount of memory allocated on the heap for objects. Decreased by major GC

oldmalloc_increase_bytes_limit

When ‘:old_malloc_increase_bytes` crosses this limit, major GC is triggered

If the optional argument, hash, is given, it is overwritten and returned. This is intended to avoid probe effect.

This method is only expected to work on CRuby.

No documentation available
No documentation available

Returns true if the file at path new is newer than all the files at paths in array old_list; false otherwise.

Argument new and the elements of old_list should be interpretable as paths:

FileUtils.uptodate?('Rakefile', ['Gemfile', 'README.md']) # => true
FileUtils.uptodate?('Gemfile', ['Rakefile', 'README.md']) # => false

A non-existent file is considered to be infinitely old.

Related: FileUtils.touch.

Returns true if the file at path new is newer than all the files at paths in array old_list; false otherwise.

Argument new and the elements of old_list should be interpretable as paths:

FileUtils.uptodate?('Rakefile', ['Gemfile', 'README.md']) # => true
FileUtils.uptodate?('Gemfile', ['Rakefile', 'README.md']) # => false

A non-existent file is considered to be infinitely old.

Related: FileUtils.touch.

No documentation available
No documentation available
No documentation available
No documentation available

Changes permissions on the entries at the paths given in list (a single path or an array of paths) to the permissions given by mode; returns list if it is an array, [list] otherwise:

Argument list or its elements should be interpretable as paths.

Argument mode may be either an integer or a string:

Keyword arguments:

Related: FileUtils.chmod_R.

Changes permissions on the entries at the paths given in list (a single path or an array of paths) to the permissions given by mode; returns list if it is an array, [list] otherwise:

Argument list or its elements should be interpretable as paths.

Argument mode may be either an integer or a string:

Keyword arguments:

Related: FileUtils.chmod_R.

Like FileUtils.chmod, but changes permissions recursively.

Like FileUtils.chmod, but changes permissions recursively.

Changes the owner and group on the entries at the paths given in list (a single path or an array of paths) to the given user and group; returns list if it is an array, [list] otherwise:

Argument list or its elements should be interpretable as paths.

User and group:

Examples:

# One path.
# User and group as string names.
File.stat('src0.txt').uid # => 1004
File.stat('src0.txt').gid # => 1004
FileUtils.chown('user2', 'group1', 'src0.txt')
File.stat('src0.txt').uid # => 1006
File.stat('src0.txt').gid # => 1005

# User and group as uid and gid.
FileUtils.chown(1004, 1004, 'src0.txt')
File.stat('src0.txt').uid # => 1004
File.stat('src0.txt').gid # => 1004

# Array of paths.
FileUtils.chown(1006, 1005, ['src0.txt', 'src0.dat'])

# Directory (not recursive).
FileUtils.chown('user2', 'group1', '.')

Keyword arguments:

Related: FileUtils.chown_R.

Changes the owner and group on the entries at the paths given in list (a single path or an array of paths) to the given user and group; returns list if it is an array, [list] otherwise:

Argument list or its elements should be interpretable as paths.

User and group:

Examples:

# One path.
# User and group as string names.
File.stat('src0.txt').uid # => 1004
File.stat('src0.txt').gid # => 1004
FileUtils.chown('user2', 'group1', 'src0.txt')
File.stat('src0.txt').uid # => 1006
File.stat('src0.txt').gid # => 1005

# User and group as uid and gid.
FileUtils.chown(1004, 1004, 'src0.txt')
File.stat('src0.txt').uid # => 1004
File.stat('src0.txt').gid # => 1004

# Array of paths.
FileUtils.chown(1006, 1005, ['src0.txt', 'src0.dat'])

# Directory (not recursive).
FileUtils.chown('user2', 'group1', '.')

Keyword arguments:

Related: FileUtils.chown_R.

Like FileUtils.chown, but changes owner and group recursively.

Like FileUtils.chown, but changes owner and group recursively.

Updates modification times (mtime) and access times (atime) of the entries given by the paths in list (a single path or an array of paths); returns list if it is an array, [list] otherwise.

By default, creates an empty file for any path to a non-existent entry; use keyword argument nocreate to raise an exception instead.

Argument list or its elements should be interpretable as paths.

Examples:

# Single path.
f = File.new('src0.txt') # Existing file.
f.atime # => 2022-06-10 11:11:21.200277 -0700
f.mtime # => 2022-06-10 11:11:21.200277 -0700
FileUtils.touch('src0.txt')
f = File.new('src0.txt')
f.atime # => 2022-06-11 08:28:09.8185343 -0700
f.mtime # => 2022-06-11 08:28:09.8185343 -0700

# Array of paths.
FileUtils.touch(['src0.txt', 'src0.dat'])

Keyword arguments:

Related: FileUtils.uptodate?.

Search took: 2ms  ·  Total Results: 1850