Method: File.realpath
- Defined in:
- file.c
.realpath(pathname[, dir_string]) ⇒ Object
Returns the real (absolute) pathname of pathname in the actual
filesystem not containing symlinks or useless dots.
If _dir_string_ is given, it is used as a base directory
for interpreting relative pathname instead of the current directory.
All components of the pathname must exist when this method is
called.
4668 4669 4670 4671 4672 4673 4674 4675 |
# File 'file.c', line 4668
static VALUE
rb_file_s_realpath(int argc, VALUE *argv, VALUE klass)
{
VALUE basedir = (rb_check_arity(argc, 1, 2) > 1) ? argv[1] : Qnil;
VALUE path = argv[0];
FilePathValue(path);
return rb_realpath_internal(basedir, path, 1);
}
|