BSD::statstat() with BSD 4.4 extentions | |
Download |
BSD::stat Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Dan Kogai
- Publisher web site:
- http://search.cpan.org/~oyama/Crypt-Camellia-2.01/lib/Crypt/Camellia.pm
BSD::stat Tags
BSD::stat Description
stat() with BSD 4.4 extentions BSD::stat is a Perl module which default exports override the core stat() and lstat() functions, replacing them with versions that contain BSD 4.4 extentions such as file flags. This module also adds chflags function.SYNOPSIS use BSD::stat; # just like CORE::stat ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks, $atimensec,$mtimensec,$ctimensec,$flags,$gen) = stat($filename); # BSD::stat now accepts filehandles, too open F, "foo"; my @stat = stat(*F); # omit an argument and it will use $_; my $_ = "foo"; my stat = stat; # stat($file) then -x _ works like CORE::stat(); stat("foo") and -x _ and print "foo is executable" # but -x $file then stat(_) will not!!! # just like File::stat $st = stat($file) or die "No $file: $!"; if ( ($st->mode & 0111) && $st->nlink > 1) ) { print "$file is executable with lotsa links\n"; } use BSD::stat qw(:FIELDS); stat($file) or die "No $file: $!"; if ( ($st_mode & 0111) && $st_nlink > 1) ) { print "$file is executable with lotsa links\n"; } # chflags chflags(UF_IMMUTABLE, @files) Requirements: · Perl
BSD::stat Related Software