niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Not Unix » VMS » vmsperl
replicating protection on files
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
Abe Timmerman
*nix forums beginner


Joined: 08 Aug 2005
Posts: 5

PostPosted: Sun May 08, 2005 11:00 am    Post subject: replicating protection on files Reply with quote

Hi,

How does one replicate the protection after copying files? I used this code:

my $mode = ( stat $abs_file )[2] & 07777;
-f $dest_name and 1 while unlink $dest_name;
my $ok = File::Copy::syscopy( $abs_file, $dest_name );
$ok and $ok &&= chmod $mode, $dest_name;
$ok or carp "copy '$file' ($dest_path): $!\n";

But it doesn't seem to replicate the full protection:
$ type prot.pl
#! perl -w
use strict;
my @files = map qq/user1:[abeltje.$_]perly.h/ => qw/perl-5_8_x perl-58x/;
for my $file ( @files ) {
printf "stat($file)[2]: %04o\n", (stat $file)[2] & 07777;
print for grep !/^\s*$/ => qx(dir/protection $file);
}
$ perl prot.pl
stat(user1:[abeltje.perl-5_8_x]perly.h)[2]: 0444
Directory USER1:[ABELTJE.PERL-5_8_X]
PERLY.H;1 (RWED,R,R,R)
Total of 1 file.
stat(user1:[abeltje.perl-58x]perly.h)[2]: 0444
Directory USER1:[ABELTJE.PERL-58X]
PERLY.H;1 (R,R,R,R)
Total of 1 file.


Good luck,

Abe
--
[ About the taint pragma proposal ]
"Mommy, mommy, look! I'm driving my bicycle without my hands!"
.....
"Mommah, mommah, mook! I'm mrivin my micicl mimof my meemh!""

-- Jarkko Hietaniemi on p5p @ 2001-12-13
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 3:59 am | All times are GMT
navigation Forum index » Not Unix » VMS » vmsperl
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts howto log in from one bsd-server to another and move file... Tobias Steer FreeBSD 3 Thu Jul 20, 2006 10:02 am
No new posts Binary Files Ronin C++ 8 Wed Jul 19, 2006 3:12 pm
No new posts Bug#378877: ITP: libsvm-doc -- documentation and example ... Rudi Cilibrasi devel 0 Wed Jul 19, 2006 1:50 pm
No new posts Bug#378873: ITP: libsvm0-dev -- development files for Lib... Rudi Cilibrasi devel 0 Wed Jul 19, 2006 1:20 pm
No new posts Bug#378866: ITP: libnanohttp1-dev -- header files for nan... Rudi Cilibrasi devel 0 Wed Jul 19, 2006 12:40 pm

Advertising | Car Finance | Homeowner Loans | Web Hosting | Xecuter 3 Mod Chip
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1102s ][ Queries: 16 (0.0475s) ][ GZIP on - Debug on ]