On Dec 1, 2007 2:59 AM, Trans <transfire / gmail.com> wrote: > > > On Nov 30, 12:07 pm, Christophe Mckeon <chromatoph... / gmail.com> > wrote: > > > i find these come in real handy, and thought they would be good for > > inclusion into FileUtils or barring that, then maybe the guys at Facets > > lib might be interested. they are based on Unix shell test options, i.e. > > [ -d somedir ] etc. > > it would be fairly trivial to implement the other test options as well. > > > > module FileUtils > > > > def b? path > > File.blockdev? path > > end > > > > def c? path > > File.chardev? path > > end > > > > def d? path > > File.directory? path > > end > > > > def e? path > > File.exists? path > > end > > > > def f? path > > File.file? path > > end > > > > def x? > > File.executable? path > > end > > Hmmm... you know about Kernel#test ? Eg. > > test ?d, path Anyone knows what happens with this in 1.9? AFAIK the ?d syntax is going away... maybe symbols instead?