mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/pathname/pathname.c (path_readlink): Pathname#readlink translated
from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ec5bb26fa0
commit
8aa17733fa
3 changed files with 19 additions and 5 deletions
|
@ -1,7 +1,12 @@
|
||||||
|
Tue Aug 10 06:26:48 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/pathname/pathname.c (path_readlink): Pathname#readlink translated
|
||||||
|
from pathname.rb.
|
||||||
|
|
||||||
Mon Aug 9 22:15:19 2010 Tanaka Akira <akr@fsij.org>
|
Mon Aug 9 22:15:19 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/pathname/pathname.c (path_open): Pathname#open
|
* ext/pathname/pathname.c (path_open): Pathname#open translated from
|
||||||
translated from pathname.rb.
|
pathname.rb.
|
||||||
|
|
||||||
Mon Aug 9 22:11:09 2010 Tanaka Akira <akr@fsij.org>
|
Mon Aug 9 22:11:09 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
|
|
@ -512,9 +512,6 @@ end
|
||||||
|
|
||||||
class Pathname # * File *
|
class Pathname # * File *
|
||||||
|
|
||||||
# See <tt>File.readlink</tt>. Read symbolic link.
|
|
||||||
def readlink() self.class.new(File.readlink(@path)) end
|
|
||||||
|
|
||||||
# See <tt>File.rename</tt>. Rename the file.
|
# See <tt>File.rename</tt>. Rename the file.
|
||||||
def rename(to) File.rename(@path, to) end
|
def rename(to) File.rename(@path, to) end
|
||||||
|
|
||||||
|
|
|
@ -355,6 +355,17 @@ path_open(int argc, VALUE *argv, VALUE self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* See <tt>File.readlink</tt>. Read symbolic link.
|
||||||
|
*/
|
||||||
|
static VALUE
|
||||||
|
path_readlink(VALUE self)
|
||||||
|
{
|
||||||
|
VALUE str;
|
||||||
|
str = rb_funcall(rb_cFile, rb_intern("readlink"), 1, get_strpath(self));
|
||||||
|
return rb_class_new_instance(1, &str, rb_obj_class(self));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* == Pathname
|
* == Pathname
|
||||||
*
|
*
|
||||||
|
@ -567,4 +578,5 @@ Init_pathname()
|
||||||
rb_define_method(rb_cPathname, "ftype", path_ftype, 0);
|
rb_define_method(rb_cPathname, "ftype", path_ftype, 0);
|
||||||
rb_define_method(rb_cPathname, "make_link", path_make_link, 1);
|
rb_define_method(rb_cPathname, "make_link", path_make_link, 1);
|
||||||
rb_define_method(rb_cPathname, "open", path_open, -1);
|
rb_define_method(rb_cPathname, "open", path_open, -1);
|
||||||
|
rb_define_method(rb_cPathname, "readlink", path_readlink, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue