--------------030408060904090006010308
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

appended is a patch that adds the dev_major and dev_minor methods to the 
File::Stat structure, similar to rdev_major and rdev_minor.

Regards,

   Michael

--------------030408060904090006010308
Content-Type: text/plain;
 nameile.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filenameile.diff"

Index: file.c
RCS file: /src/ruby/file.c,v
retrieving revision 1.183
diff -u -r1.183 file.c
--- file.c	4 Jun 2004 09:54:15 -0000	1.183
+++ file.c	16 Jul 2004 13:30:28 -0000
@@ -217,6 +217,52 @@
     return INT2NUM(get_stat(self)->st_dev);
 }
 
+/*
+ *  call-seq:
+ *     stat.dev_major   fixnum
+ *  
+ *  Returns the major part of <code>File_Stat#dev</code> or
+ *  <code>nil</code>.
+ *     
+ *     File.stat("/dev/fd1").dev_major   #2
+ *     File.stat("/dev/tty").dev_major   #5
+ */
+
+static VALUE
+rb_stat_dev_major(self)
+    VALUE self;
+{
+#if defined(major)
+    long dev  et_stat(self)->st_dev;
+    return ULONG2NUM(major(dev));
+#else
+    return Qnil;
+#endif
+}
+
+/*
+ *  call-seq:
+ *     stat.dev_minor   fixnum
+ *  
+ *  Returns the minor part of <code>File_Stat#dev</code> or
+ *  <code>nil</code>.
+ *     
+ *     File.stat("/dev/fd1").dev_minor   #1
+ *     File.stat("/dev/tty").dev_minor   #0
+ */
+
+static VALUE
+rb_stat_dev_minor(self)
+    VALUE self;
+{
+#if defined(minor)
+    long dev  et_stat(self)->st_dev;
+    return ULONG2NUM(minor(dev));
+#else
+    return Qnil;
+#endif
+}
+
 
 /*
  *  call-seq:
@@ -4319,6 +4365,8 @@
     rb_define_method(rb_cStat, "<, rb_stat_cmp, 1);
 
     rb_define_method(rb_cStat, "dev", rb_stat_dev, 0);
+    rb_define_method(rb_cStat, "dev_major", rb_stat_dev_major, 0);
+    rb_define_method(rb_cStat, "dev_minor", rb_stat_dev_minor, 0);
     rb_define_method(rb_cStat, "ino", rb_stat_ino, 0);
     rb_define_method(rb_cStat, "mode", rb_stat_mode, 0);
     rb_define_method(rb_cStat, "nlink", rb_stat_nlink, 0);

--------------030408060904090006010308--