path()
public
Returns the pathname used to create file as a string. Does not
normalize the name.
File.new("testfile").path
File.new("/tmp/../tmp/xxx", "w").path
Show source
/*
* call-seq:
* file.path -> filename
*
* Returns the pathname used to create <i>file</i> as a string. Does
* not normalize the name.
*
* File.new("testfile").path
* File.new("/tmp/../tmp/xxx", "w").path
*
*/
static VALUE
rb_file_path(obj)
VALUE obj;
{
rb_io_t *fptr;
fptr = RFILE(rb_io_taint_check(obj))->fptr;
rb_io_check_initialized(fptr);
if (!fptr->path) return Qnil;
return rb_tainted_str_new2(fptr->path);
}