getwd()
public
Returns the path to the current working
directory of this process as a string.
Dir.chdir("/tmp")
Dir.getwd
Show source
static VALUE
dir_s_getwd(VALUE dir)
{
char *path;
VALUE cwd;
rb_secure(4);
path = my_getcwd();
cwd = rb_tainted_str_new2(path);
rb_enc_associate(cwd, rb_filesystem_encoding());
xfree(path);
return cwd;
}