Project

General

Profile

Actions

Feature #4046

closed

Saving C's **argv and cwd allows Ruby programs to reliably restart themselves

Added by rocky (Rocky Bernstein) about 14 years ago. Updated almost 7 years ago.

Status:
Feedback
Assignee:
-
Target version:
-
[ruby-core:33146]

Description

=begin
In a debugger often one gets to a state where one just wants to restart everything exactly the way the program was previously invoked.

It would helpful if Ruby saved **argv and cwd.

The attached patch saves these in RubyVM::OS_ARGV and RubyVM::OS_STARTUP_DIR. With this,
if a Ruby program wants to restart itself, it can run:

chdir RubyVM::OS_STARTUP_DIR
exec(*RubyVM::OS_ARGV)
=end


Files

OS_ARGV_and_STARTUP_DIR.patch (3.02 KB) OS_ARGV_and_STARTUP_DIR.patch Save C's **argv and cwd as RubyVM::OS_ARGV and RubyVM::OS_STARTUP_DIR rocky (Rocky Bernstein), 11/12/2010 12:32 PM

Related issues 2 (1 open1 closed)

Has duplicate Ruby master - Feature #6648: Provide a standard API for retrieving all command-line flags passed to RubyAssignedmatz (Yukihiro Matsumoto)Actions
Has duplicate Ruby master - Feature #6793: easier ability to "run as the currently running ruby"FeedbackActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0