Method: File.dirname
- Defined in:
- file.c
.dirname(file_name) ⇒ Object
Returns all components of the filename given in file_name except the last one (after first stripping trailing separators). The filename can be formed using both File::SEPARATOR and File::ALT_SEPARATOR as the separator when File::ALT_SEPARATOR is not nil.
File.dirname("/home/gumby/work/ruby.rb") #=> "/home/gumby/work"
4685 4686 4687 4688 4689 |
# File 'file.c', line 4685
static VALUE
rb_file_s_dirname(VALUE klass, VALUE fname)
{
return rb_file_dirname(fname);
}
|