Feature #4712

File.writable? inaccurate in windows

Added by Roger Pack almost 3 years ago. Updated over 1 year ago.

[ruby-core:36228]
Status:Feedback
Priority:Normal
Assignee:-
Category:-
Target version:next minor

Description

Hello. Here's what happens (when a user doesn't have admin privileges in windows 7):

c:\Program Files (x86)\NetBeans 6.9.1>irb --simple-prompt

File.writable?('.')
=> true
File.writable?('./uninstall.exe')
=> true
File.open('./uninstall.exe', 'wb')
Errno::EACCES: Permission denied - ./uninstall.exe
from (irb):4:in initialize'
from (irb):4:in
open'
from (irb):4

So I think writable was returning true in error here.
Cheers!
-r

History

#1 Updated by Usaku NAKAMURA almost 3 years ago

  • ruby -v changed from ruby 1.9.2p180 (2011-02-18) [i386-mingw32] to -

Hello,

In message " [Ruby 1.9 - Bug #4712][Open] File.writable? inaccurate in windows"
on May.17,2011 02:04:06, rogerpack2005@gmail.com wrote:

File.open('./uninstall.exe', 'wb')
Errno::EACCES: Permission denied - ./uninstall.exe
from (irb):4:in initialize'
from (irb):4:in
open'
from (irb):4

Please show us the result of attrib and cacls.

Regards,
--
U.Nakamura usa@garbagecollect.jp

#2 Updated by Roger Pack almost 3 years ago

c:\Program Files (x86)\NetBeans 6.9.1>attrib uninstall.exe
A C:\Program Files (x86)\NetBeans 6.9.1\uninstall.exe

c:\Program Files (x86)\NetBeans 6.9.1>cacls uninstall.exe
c:\Program Files (x86)\NetBeans 6.9.1\uninstall.exe NT AUTHORITY\SYSTEM:(ID)F
BUILTIN\Administrators:(ID)F
BUILTIN\Users:(ID)R

#3 Updated by Usaku NAKAMURA almost 3 years ago

Thank you, Roger.

Currently we don't support NTFS ACLs.
This is the one of lacks of the important features, I think.
We shall support it someday.
The problem is who/when/how does it...

#4 Updated by Usaku NAKAMURA almost 3 years ago

  • Tracker changed from Bug to Feature

#5 Updated by Roger Pack almost 3 years ago

Ok good to know.

#6 Updated by Yusuke Endoh about 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Yusuke Endoh

#7 Updated by Yusuke Endoh about 2 years ago

  • Status changed from Assigned to Feedback
  • Assignee deleted (Yusuke Endoh)

Hello,

usa wrote:

The problem is who/when/how does it...

We need contribution. I mark this ticket as Feedback.

Yusuke Endoh mame@tsg.ne.jp

#8 Updated by Yusuke Endoh over 1 year ago

  • Target version set to next minor

Also available in: Atom PDF