File.dirname(file_name) รข dir_name
Class Public methods
Returns all components of the filename given in file_name except
the last one. The filename can be formed using both
File::SEPARATOR
and File::ALT_SEPARETOR
as the
separator when File::ALT_SEPARATOR
is not nil
.
File.dirname("/home/gumby/work/ruby.rb") #=> "/home/gumby/work"
Please login to continue.