From: Trans Date: 2006-08-15T02:15:08+09:00 Subject: Re: sh command that ascends dir tree for executable Jeffrey Schwab wrote: > Trans wrote: > > Hmmm... What does: > > > > File.expand_path('/') > > Eureka. > > irb(main):001:0> File.expand_path('/') > => "C:/" > irb(main):002:0> File.expand_path('C:/..') > => "C:/" Let ty this: def FileTest.root?(dir) pth = File.expand_path(dir) return true if pth == '/' return true if pth =~ /^(\w:)?\/$/ false end The == line should give a slight speed boost to unix systems. T.