[ruby-core:96165] [Ruby master Misc#16396] What is the reason for this behaviour of Find.find?

[email protected]
Newsgroups gmane.comp.lang.ruby.core
Message-ID <redmine.journal-83043.20191209145100.76e167c634cd0a22@ruby-lang.org>
Issue #16396 has been updated by Dan0042 (Daniel DeLorme).


From what I remember of Windows, `Find.find('D:')` would search in the current directory of D:
My guess is that you're actually executing the first script from `D:\Downloads\Ruby 2.5.3\rbL\comp\` and the second script from `D:\` (or maybe `C:\some\dir\`?)
So you may want to check the value of `Dir.pwd` in each case.

----------------------------------------
Misc #16396: What is the reason for this behaviour of Find.find?
https://bugs.ruby-lang.org/issues/16396#change-83043

* Author: stiuna (Juan Gregorio)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
When I have a script at `D:\Downloads\Ruby 2.5.3\rbL\comp\codeShort.rb` with few other files in the same folder, the following searches only the folder where the `.rb` script is located:

``` ruby
Find.find('D:')
```

When I have a script at `D:\Downloads\Ruby 2.5.3\rbL\codeShort.rb` with many other files in the same folder, the same code as above searches the entire disk D.

To search the entire disk D in the first case, I did this:

``` ruby
Find.find('D:/')
```

But I don't understand why the two cases behave differently with the same instruction just because they script are in different directories.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.