Project

General

Profile

Actions

Feature #4712

closed

File.writable? inaccurate in windows

Feature #4712: File.writable? inaccurate in windows

Added by rogerdpack (Roger Pack) over 14 years ago. Updated almost 8 years ago.

Status:
Feedback
Assignee:
-
Target version:
-
[ruby-core:36228]

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

Updated by usa (Usaku NAKAMURA) over 14 years ago Actions #1 [ruby-core:36252]

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

Hello,

In message "[ruby-core:36228] [Ruby 1.9 - Bug #4712][Open] File.writable? inaccurate in windows"
on May.17,2011 02:04:06, 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

Updated by rogerdpack (Roger Pack) over 14 years ago Actions #2

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

Updated by usa (Usaku NAKAMURA) over 14 years ago Actions #3

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...

Updated by usa (Usaku NAKAMURA) over 14 years ago Actions #4

  • Tracker changed from Bug to Feature

Updated by rogerdpack (Roger Pack) over 14 years ago Actions #5 [ruby-core:36280]

Ok good to know.

Updated by mame (Yusuke Endoh) over 13 years ago Actions #6 [ruby-core:43625]

  • Status changed from Open to Assigned
  • Assignee set to mame (Yusuke Endoh)

Updated by mame (Yusuke Endoh) over 13 years ago Actions #7

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

Hello,

usa wrote:

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

We need contribution. I mark this ticket as Feedback.

--
Yusuke Endoh

Updated by mame (Yusuke Endoh) almost 13 years ago Actions #8 [ruby-core:49721]

  • Target version set to 2.6

Updated by djberg96 (Daniel Berger) over 10 years ago Actions #9 [ruby-core:68129]

Use win32-file if you want a working File.writable? on Windows.

Updated by naruse (Yui NARUSE) almost 8 years ago Actions #10

  • Target version deleted (2.6)
Actions

Also available in: PDF Atom