[macruby-changes] [2040] MacRuby/branches/experimental

source_changes at macosforge.org source_changes at macosforge.org
Tue Jul 21 14:45:51 PDT 2009


Revision: 2040
          http://trac.macosforge.org/projects/ruby/changeset/2040
Author:   pthomson at apple.com
Date:     2009-07-21 14:45:50 -0700 (Tue, 21 Jul 2009)
Log Message:
-----------
Re-enabled File#path, File#atime, and their specs.

Modified Paths:
--------------
    MacRuby/branches/experimental/file.c

Removed Paths:
-------------
    MacRuby/branches/experimental/spec/frozen/tags/macruby/core/file/atime_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/macruby/core/file/path_tags.txt

Modified: MacRuby/branches/experimental/file.c
===================================================================
--- MacRuby/branches/experimental/file.c	2009-07-21 18:06:06 UTC (rev 2039)
+++ MacRuby/branches/experimental/file.c	2009-07-21 21:45:50 UTC (rev 2040)
@@ -164,13 +164,8 @@
 static VALUE
 rb_file_path(VALUE obj, SEL sel)
 {
-    // rb_io_t *fptr;
-    // 
-    // fptr = RFILE(rb_io_taint_check(obj))->fptr;
-    // rb_io_check_initialized(fptr);
-    // if (!fptr->path) return Qnil;
-    // return rb_tainted_str_new2(fptr->path);
-    rb_notimplement();
+	rb_io_t *io = ExtractIOStruct(obj);
+	return (io->path == NULL ? Qnil : (VALUE)io->path);
 }
 
 static VALUE
@@ -1667,15 +1662,12 @@
 static VALUE
 rb_file_atime(VALUE obj, SEL sel)
 {
-    //     rb_io_t *fptr;
-    //     struct stat st;
-    // 
-    //     GetOpenFile(obj, fptr);
-    //     if (fstat(fptr->fd, &st) == -1) {
-    // rb_sys_fail(fptr->path);
-    //     }
-    //     return stat_atime(&st);
-        rb_notimplement();
+	struct stat st;
+    struct rb_io_t *io = ExtractIOStruct(obj);
+    if (fstat(io->fd, &st) == -1) {
+	rb_sys_fail(RSTRING_PTR(io->path));
+    }
+	return stat_atime(&st);
 }
 
 /*

Deleted: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/file/atime_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/file/atime_tags.txt	2009-07-21 18:06:06 UTC (rev 2039)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/file/atime_tags.txt	2009-07-21 21:45:50 UTC (rev 2040)
@@ -1 +0,0 @@
-fails:File#atime returns the last access time to self

Deleted: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/file/path_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/file/path_tags.txt	2009-07-21 18:06:06 UTC (rev 2039)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/file/path_tags.txt	2009-07-21 21:45:50 UTC (rev 2040)
@@ -1 +0,0 @@
-fails:File#path returns the pathname used to create file as a string
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090721/0ef9559c/attachment-0001.html>


More information about the macruby-changes mailing list