Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: (no subject
Heesob Park
4/28/2008 2:10:00 AM
Hi,
Dave Smith wrote:
> I'm trying to use win32/file to set permission on a file, but I can't
> seem
> to get it working. Here's what I've tried
>
> require "win32/file"
> File.set_permissions("C:\\foo.txt", {"Domain\\username" => 2032127})
>
> and I get this error
>
> :/ruby/lib/ruby/gems/1.8/gems/win32-file-0.5.5/lib/win32/file.rb:212:in
> `set_permissions': The access control list (ACL) structure is invalid.
> (ArgumentError)
>
In the current version, it means the given account do not exist.
The misleading message must be modified.
Inserting the following line at file.rb #158 will solve this problem.
if sid.strip == ""
raise ArgumentError, 'Account does not exist'
end
> I can read permissions I just can't set them.
Try this:
perm = File.get_permissions("C:\\foo.txt")
p perm
File.set_permissions("C:\\foo.txt",perm)
Regards,
Park Heesob
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: (no subject
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password