Forum: Ruby Is there any difference between Dir::exist? and Dir::::exists?

Posted by Love U Ruby (my-ruby)
on 2013-01-30 14:58
Hi,


I am confused with the below Dir class methods:

Dir::exist?
Dir::::exists?

Can anyone help me here to understand the difference between them with
an simple example?


Thanks
Posted by Joel Pearson (virtuoso)
on 2013-01-30 15:30
"Dir::::exists?" doesn't exist.

exists? and exist? are aliases, I think.

Personally I use File.directory?
Posted by Robert Klemme (robert_k78)
on 2013-01-30 15:38
(Received via mailing list)
On Wed, Jan 30, 2013 at 2:58 PM, Arup Rakshit <lists@ruby-forum.com> 
wrote:
> Hi,
>
>
> I am confused with the below Dir class methods:
>
> Dir::exist?
> Dir::::exists?

That is a syntax error.  I guess you mean Dir::exists?.

> Can anyone help me here to understand the difference between them with
> an simple example?

Why do you assume there is a difference?  Did you read the 
documentation?  Hint:

$ diff -U5 <(ri -T Dir::exist?) <(ri -T Dir::exists?)
--- /dev/fd/63  2013-01-30 15:30:24.000000000 +0100
+++ /dev/fd/62  2013-01-30 15:30:24.000000000 +0100
@@ -1,6 +1,6 @@
-= Dir::exist?
+= Dir::exists?

 (from ruby core)
 ------------------------------------------------------------------------------
   File.directory?(file_name)   ->  true or false



Kind regards

robert
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.