| Last Update: | Tue Jul 24 07:42:08 -0600 2007 |
Adds ACL support for the File class on Solaris.
Ruby 1.8.x
rake test (optional)
rake install
rake test (optional)
rake install_gem
require "solaris/file"
f = "some_file.txt"
acl_text = "user::rw-,user:nobody:r--,"
acl_text << "group::r--,group:sys:r--,mask:r--,other:r--"
File.trivial?(f) # probably true
File.acl_write_text(acl_text)
# No longer a trivial file
File.trivial?(f) # false
File.acl_read(f).each{ |acl| p acl }
File.acl_count(file_name)
Returns the number of ACL entries for the file. Returns 0 if it's a trivial file.
File.acl_read(file_name)
Returns an Array of ACLStruct's or nil if file_name is a trivial file.
Fiel.acl_read_text(file_name)
Returns a String form of the ACL entries for the file. Returns nil if it's a trivial ACL.
File.acl_write_text(file_name, acl_string)
Accepts a formatted ACL string that set the ACL for the file. If the string is badly formed, a File::SolarisError is raised.
File.realpath(path)
Resolves all symbolic links in +path+. Resolves to an absolute pathname where possible.
File.resolvepath(path)
Resolves all symbolic links in +path+. All "." components are removed, as well as all nonleading ".." components and their blockquoteceding directory component. If leading ".." components resolve to the root directory, they are replaced by "/".
File.trivial?(file_name)
Returns true if the file is a trivial ACL file, i.e. has no ACL entries for additional users or groups.
File#acl_count
Returns the number of ACL entries for the file. Returns 0 if it's a trivial file.
File#acl_read
Returns an Array of ACLStruct's.
File#acl_read_text
Returns a String form of the ACL entries for the file. Returns nil if it's a trivial ACL.
File#acl_write_text(acl_string)
Accepts a formatted ACL string that set the ACL for the file. If the string is badly formed, a File::SolarisError is raised.
File#trivial?
Returns true if the file is a trivial ACL file, i.e. has no ACL entries for additional users or groups
File::SOLARIS_VERSION
Returns the current version number of this package as a String.
File::SolarisError < StandardError
Raised if anything goes wrong with any of the above methods.
None that I am aware of. Please report any bugs using the tracker on the project page at http://www.rubyforge.org/projects/solarisutils
Add File.acl_write and File#acl_write methods that accept an array of ACLStruct's.
Add support for extended file attributes.
This is a BETA release. The code is stable, the API is not.
(C) 2005-2007 Daniel J. Berger
All Rights Reserved
This package is provided "as is" and without any exblockquotess or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.
Ruby's
Daniel J. Berger
djberg96 [at nospam at gmail dot com]
imperator on IRC (irc.freenode.net)