File::chmod

File::chmod is a Perl module that implements symbolic and ls chmod modes.
Download

File::chmod Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jeff Pinyan
  • Publisher web site:
  • http://search.cpan.org/~pinyan/YAPE-Regex-3.03/Regex/Element.pm

File::chmod Tags


File::chmod Description

File::chmod is a Perl module that implements symbolic and ls chmod modes. File::chmod is a Perl module that implements symbolic and ls chmod modes.SYNOPSIS use File::chmod; # chmod takes all three types # these all do the same thing chmod(0666,@files); chmod("=rw",@files); chmod("-rw-rw-rw-",@files); # or use File::chmod qw( symchmod lschmod ); chmod(0666,@files); # this is the normal chmod symchmod("=rw",@files); # takes symbolic modes only lschmod("-rw-rw-rw-",@files); # takes "ls" modes only # more functions, read on to understandFile::chmod is a utility that allows you to bypass system calls or bit processing of a file's permissions. It overloads the chmod() function with its own that gets an octal mode, a symbolic mode (see below), or an "ls" mode (see below). If you wish not to overload chmod(), you can export symchmod() and lschmod(), which take, respectively, a symbolic mode and an "ls" mode.Symbolic modes are thoroughly described in your chmod(1) man page, but here are a few examples. # NEW: if $UMASK is true, symchmod() applies a bit-mask found in $MASK chmod("+x","file1","file2"); # overloaded chmod(), that is... # turns on the execute bit for all users on those two files chmod("o=,g-w","file1","file2"); # removes 'other' permissions, and the write bit for 'group' chmod("=u","file1","file2"); # sets all bits to those in 'user'"ls" modes are the type produced on the left-hand side of an ls -l on a directory. Examples are: chmod("-rwxr-xr-x","file1","file2"); # the 0755 setting; user has read-write-execute, group and others # have read-execute priveleges chmod("-rwsrws---","file1","file2"); # sets read-write-execute for user and group, none for others # also sets set-uid and set-gid bitsThe regular chmod() and lschmod() are absolute; that is, they are not appending to or subtracting from the current file mode. They set it, regardless of what it had been before. symchmod() is useful for allowing the modifying of a file's permissions without having to run a system call or determining the file's permissions, and then combining that with whatever bits are appropriate. It also operates separately on each file.An added feature to version 0.30 is the $UMASK variable, explained below; if symchmod() is called and this variable is true, then the function uses the (also new) $MASK variable (which defaults to umask()) as a mask against the new mode. This is documented below more clearly.Requirements:· Perl Requirements: · Perl


File::chmod Related Software