Results for: "Dir.chdir"

Updates modification time (mtime) and access time (atime) of file(s) in list. Files are created if they don’t exist.

FileUtils.touch 'timestamp'
FileUtils.touch Dir.glob('*.c');  system 'make'

Updates modification time (mtime) and access time (atime) of file(s) in list. Files are created if they don’t exist.

FileUtils.touch 'timestamp'
FileUtils.touch Dir.glob('*.c');  system 'make'

Set the changed state of this object. Notifications will be sent only if the changed state is true.

state

Boolean indicating the changed state of this Observable.

Returns true if this object’s state has been changed since the last notify_observers call.

Some operating systems retain the status of terminated child processes until the parent collects that status (normally using some variant of wait()). If the parent never collects this status, the child stays around as a zombie process. Process::detach prevents this by setting up a separate Ruby thread whose sole job is to reap the status of the process pid when it terminates. Use detach only when you do not intend to explicitly wait for the child to terminate.

The waiting thread returns the exit status of the detached process when it terminates, so you can use Thread#join to know the result. If specified pid is not a valid child process ID, the thread returns nil immediately.

The waiting thread has pid method which returns the pid.

In this first example, we don’t reap the first child process, so it appears as a zombie in the process status display.

p1 = fork { sleep 0.1 }
p2 = fork { sleep 0.2 }
Process.waitpid(p2)
sleep 2
system("ps -ho pid,state -p #{p1}")

produces:

27389 Z

In the next example, Process::detach is used to reap the child automatically.

p1 = fork { sleep 0.1 }
p2 = fork { sleep 0.2 }
Process.detach(p1)
Process.waitpid(p2)
sleep 2
system("ps -ho pid,state -p #{p1}")

(produces no output)

Extract platform given on the command line

No documentation available
No documentation available

Adds name with permissions mode to the tar, yielding io for writing the file. The digest_algorithm is written to a read-only name.sum file following the given file contents containing the digest name and hexdigest separated by a tab.

The created digest object is returned.

The required_ruby_version constraint for this specification

A fallback is included because when generated, some marshalled specs have it set to nil.

The required_rubygems_version constraint for this specification

A fallback is included because the original version of the specification API didn’t include that field, so some marshalled specs in the index have it set to nil.

The required_ruby_version constraint for this specification

The required_rubygems_version constraint for this specification

Like Enumerable#chunk, but chains operation to be lazy-evaluated.

Iterates over the elements of the first enumerable by calling the “each” method on it with the given arguments, then proceeds to the following enumerables in sequence until all of the enumerables are exhausted.

If no block is given, returns an enumerator.

No documentation available
No documentation available

For a block.

Receive the section and its pairs for the current configuration.

config.each do |section, key, value|
  # ...
end
No documentation available
No documentation available
No documentation available
No documentation available

See Zlib::GzipReader documentation for a description.

See Zlib::GzipReader documentation for a description.

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
Search took: 3ms  ·  Total Results: 995