From: Jamis Buck Date: 2004-12-25T14:43:59+09:00 Subject: Re: non-OO realpath, basename, dirname? On 12:32 Sat 25 Dec , David Garamond wrote: > Is there a better way than below? (Note: I don't want to implement > realpath et al myself :-). > > require 'pathname' > > def realpath(p) > Pathname.new(p).realpath > end > > def basename(p) > Pathname.new(p).basename > end > > def dirname(p) > Pathname.new(p).dirname > end > > Regards, > dave > > For basename and dirname: File.basename(p) File.dirname(p) Dunno for realpath :( - Jamis -- Jamis Buck jgb3@email.byu.edu http://www.jamisbuck.org/jamis