[#86520] [Ruby trunk Bug#14681] `syswrite': stream closed in another thread (IOError) — samuel@...
Issue #14681 has been reported by ioquatix (Samuel Williams).
3 messages
2018/04/12
[#86755] [Ruby trunk Feature#14723] [WIP] sleepy GC — normalperson@...
Issue #14723 has been reported by normalperson (Eric Wong).
6 messages
2018/04/29
[ruby-core:86614] [CommonRuby Feature#8258] Dir#escape_glob
From:
mame@...
Date:
2018-04-19 15:54:47 UTC
List:
ruby-core #86614
Issue #8258 has been updated by mame (Yusuke Endoh).
Eregon (Benoit Daloze) wrote:
> Looks to me like this can be closed since we have Dir.glob(pattern, base: dir) and Pathname#glob uses it.
Consider that we want to enumerate all files that are under a specified directory and whose name is also specified. If the name in question is "foo.txt" for example, we can do it by:
```
basedir = "/path/to/base/dir/"
filename = "foo.txt"
Dir.glob(basedir + "**/" + filename) # or Dir.glob("**/" + filename, base: basedir)?
```
However, if `filename` is "foo[bar]baz.txt", this code does not work. In this case, this feature is still useful.
(I personally prefer `File.fnmatch_escape` to `Dir.escape_glob`.)
----------------------------------------
Feature #8258: Dir#escape_glob
https://bugs.ruby-lang.org/issues/8258#change-71572
* Author: steveklabnik (Steve Klabnik)
* Status: Feedback
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
This is inspired by https://github.com/rails/rails/issues/6010.
Basically, if you do a Dir.glob in a directory whose name contains a glob character, things break. It would be nice to have a method which would escape the input so that we can Dir.glob inside of those directories.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>