Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Dir.getwd
Dir.pwd → string
dir.c
View on GitHub ↗
static VALUE
dir_s_getwd(VALUE dir)
{
return rb_dir_getwd();
}
Returns the path to the current working directory:
Example
Dir.chdir("/tmp") # => 0 Dir.pwd # => "/tmp"