From: tamouse mailing lists Date: 2013-01-30T10:31:47+09:00 Subject: Re: Linux mode bits On Tue, Jan 29, 2013 at 4:06 PM, Rob Marshall wrote: > Is there a class available for handling the Linux mode bits? i.e. > Assuming I have the access mode of a file as a number, e.g. 33188 > (octal: 0100644), can I test the mode bits? In Python I can use the > 'stat' module which has all of the bits defined as well as tests like: > S_ISREG(). Is there something analogous in Ruby? minimally, FIle.stat(filename).mode will give the file's mode bits as a Fixnum: 1.9.3-head :007 > "%o" % File.stat('.emacs').mode => "100644"