Project

General

Profile

Actions

Bug #1005

closed

Strange behaviour of File.directory? under Windows

Added by Dadooda (Alex Fortuna) almost 16 years ago. Updated over 13 years ago.

Status:
Closed
ruby -v:
[ruby-core:21269]

Description

=begin
Under Windows:
C:>ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32]
C:>irb
irb(main):001:0> File.directory? ".."
=> true
irb(main):002:0> File.directory? "..."
=> true
irb(main):003:0> File.directory? ".............."
=> true

Under Unix:

ruby --version

ruby 1.8.5 (2006-08-25) [i386-linux]

irb

irb(main):001:0> File.directory? ".."
=> true
irb(main):002:0> File.directory? "..."
=> false
irb(main):003:0> File.directory? "........"
=> false

I.e. it looks like File.directory? returns true under Windows if filename contains any number of dots.

Sorry, could'n test this exact Ruby version under Unix.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0