From: "phasis68 (Heesob Park)" Date: 2013-07-03T11:06:00+09:00 Subject: [ruby-core:55764] [ruby-trunk - Bug #8597][Open] Unexpected result of Dir.glob of '<' or '>' on Windows Issue #8597 has been reported by phasis68 (Heesob Park). ---------------------------------------- Bug #8597: Unexpected result of Dir.glob of '<' or '>' on Windows https://bugs.ruby-lang.org/issues/8597 Author: phasis68 (Heesob Park) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.1.0dev (2013-07-02 trunk 41732) [i386-mswin32_100] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN I have found the following results of Dir.glob when containing '<' or '>' on path. C:\Users\phasis>irb irb(main):001:0> Dir.glob('>') => [">"] irb(main):002:0> Dir.glob('<') => ["<"] irb(main):003:0> Dir.glob('>><<>><<') => [">><<>><<"] irb(main):004:0> Dir.glob('>>.<<') => [">>.<<"] irb(main):005:0> Dir.glob('<><>.<><>') => ["<><>.<><>"] irb(main):006:0> Dir.glob('a<<<') => ["a<<<"] irb(main):007:0> Dir.glob('.<<<') => [".<<<"] irb(main):008:0> Dir.glob('>>.rb') => [">>.rb"] These results are due to a bug of stat function of Windows. I think it would be better to raise Invalid argument error like File.stat. irb(main):010:0> File.stat('>>.rb') Errno::EINVAL: Invalid argument @ rb_file_s_stat - >>.rb from (irb):10:in `stat' from (irb):10 from c:/usr/bin/irb.bat:18:in `
' -- http://bugs.ruby-lang.org/