dirname

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"
doc_ruby_on_rails
2015-04-06 09:59:54
Comments
Leave a Comment

Please login to continue.