Project

General

Profile

Actions

Bug #4354

closed

File.realdirpath is expected to test for real file.

Added by luislavena (Luis Lavena) over 11 years ago. Updated about 11 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
1.9.2-p136 and ruby 1.9.3dev (2011-02-02 trunk 30758) [i386-mingw32]
Backport:
[ruby-core:35036]

Description

=begin
Hello,

Comparing File.realpath behavior with File.realdirpath behavior, they don't match:

 
 $ mkdir -p ~/foo/bar
 $ cd /home/user/foo/
 $ touch a.rb
 
 $ ruby -ve "puts File.realpath('a.rb')"
 ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]
 /home/user/foo/a.rb
 
 $ ruby -ve "puts File.realpath('b.rb')"
 ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]
 -e:1:in `realpath': No such file or directory - /home/user/foo/b.rb (Errno::ENOENT)
         from -e:1:in `'
 
 $ ruby -ve "puts File.realdirpath('bar')"
 ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]
 /home/user/foo/bar
 
 $ ruby -ve "puts File.realdirpath('baz')"
 ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]
 /home/user/foo/baz
 
 $ ls -l
 total 4
 -rw-r--r-- 1 user user    0 2011-02-01 23:00 a.rb
 drwxr-xr-x 2 user user 4096 2011-02-01 23:00 bar
 
 

If 'real' is attempting to check for real files, also realdir should be behaving similar, correct?
=end

Actions #1

Updated by akr (Akira Tanaka) over 11 years ago

=begin
2011/2/2 Luis Lavena :

If 'real' is attempting to check for real files, also realdir should be behaving similar, correct?

The statement, "The last component of the real pathname can be nonexistent."
in the document explains the behavior.

Tanaka Akira

=end

Actions #2

Updated by luislavena (Luis Lavena) over 11 years ago

  • Status changed from Open to Rejected

=begin

=end

Actions #3

Updated by luislavena (Luis Lavena) over 11 years ago

=begin
On Wed, Feb 2, 2011 at 12:32 AM, Tanaka Akira wrote:

2011/2/2 Luis Lavena :

If 'real' is attempting to check for real files, also realdir should be behaving similar, correct?

The statement, "The last component of the real pathname can be nonexistent."
in the document explains the behavior.

Thank you, somehow I missed that part, and that clarifies the behavior.

--
Luis Lavena
AREA 17

Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

=end

Actions

Also available in: Atom PDF