1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* file.c (Init_File): File.exists? revived.

* dir.c (Init_Dir): Dir.exists? again.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-12-21 03:34:26 +00:00
parent 74a0c0cc7e
commit bda85cb021
3 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Fri Dec 21 12:32:08 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* file.c (Init_File): File.exists? revived.
* dir.c (Init_Dir): Dir.exists? again.
Fri Dec 21 12:26:36 2007 Koichi Sasada <ko1@atdot.net>
* compile.c: remove "illegal".

1
dir.c
View file

@ -1904,6 +1904,7 @@ Init_Dir(void)
rb_define_singleton_method(rb_cDir,"glob", dir_s_glob, -1);
rb_define_singleton_method(rb_cDir,"[]", dir_s_aref, -1);
rb_define_singleton_method(rb_cDir,"exist?", rb_file_directory_p, 1); /* in file.c */
rb_define_singleton_method(rb_cDir,"exists?", rb_file_directory_p, 1); /* in file.c */
rb_define_singleton_method(rb_cFile,"fnmatch", file_s_fnmatch, -1);
rb_define_singleton_method(rb_cFile,"fnmatch?", file_s_fnmatch, -1);

4
file.c
View file

@ -980,6 +980,7 @@ eaccess(const char *path, int mode)
*
* call-seq:
* Dir.exist?(file_name) => true or false
* Dir.exists?(file_name) => true or false
*
* Returns <code>true</code> if the named file is a directory,
* <code>false</code> otherwise.
@ -1160,7 +1161,7 @@ rb_file_chardev_p(VALUE obj, VALUE fname)
/*
* call-seq:
* File.exist?(file_name) => true or false
* File.exists?(file_name) => true or false (obsolete)
* File.exists?(file_name) => true or false
*
* Return <code>true</code> if the named file exists.
*/
@ -4442,6 +4443,7 @@ Init_File(void)
define_filetest_function("directory?", rb_file_directory_p, 1);
define_filetest_function("exist?", rb_file_exist_p, 1);
define_filetest_function("exists?", rb_file_exist_p, 1);
define_filetest_function("readable?", rb_file_readable_p, 1);
define_filetest_function("readable_real?", rb_file_readable_real_p, 1);
define_filetest_function("world_readable?", rb_file_world_readable_p, 1);