summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-21 15:06:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-21 15:06:59 +0000
commit058d55ad2c6d20bc8d169f025b65e24805e59315 (patch)
tree5d00cffd0a349260c38e264bf3252792d04fd281 /file.c
parent274e50c1892eaa24c2287146a43360a576a6a465 (diff)
file.c: warn File.exists?
* file.c (rb_file_exists_p): warn deprecated name. [Bug #9041] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/file.c b/file.c
index 5feadb6578..1468afe149 100644
--- a/file.c
+++ b/file.c
@@ -1397,6 +1397,13 @@ rb_file_exist_p(VALUE obj, VALUE fname)
return Qtrue;
}
+static VALUE
+rb_file_exists_p(VALUE obj, VALUE fname)
+{
+ rb_warning("File.exists? is deprecated name, use File.exist? instead");
+ return rb_file_exist_p(obj, fname);
+}
+
/*
* call-seq:
* File.readable?(file_name) -> true or false
@@ -5579,7 +5586,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("exists?", rb_file_exists_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);