home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 February / Chip_2004-02_cd1.bin / opsys / macos / batt / batt.dmg / BatteryUpdate.pkg / Contents / Resources / preflight < prev    next >
Text File  |  2003-11-20  |  605b  |  28 lines

  1. #!/usr/bin/perl -w
  2. use strict;
  3.  
  4. my $permissions_info_file = "/tmp/com.apple.installation.savedperm";
  5. my $target_disk = $ARGV[2];
  6. my @stat_info;
  7. my $MODE = 2;
  8. my $UID = 4;
  9. my $GID = 5;
  10.  
  11. if (-e $permissions_info_file ) {
  12.     unlink($permissions_info_file) || print "Error deleting previous saved permissions file.\n";
  13. }
  14.  
  15. @stat_info = stat($target_disk);
  16.  
  17. if(open(PERMS_FILE_HDL, ">$permissions_info_file")) {
  18.     print(PERMS_FILE_HDL join("\n", stat($target_disk)));
  19.     close(PERMS_FILE_HDL);
  20.     chmod(oct(700), "$permissions_info_file");
  21. } else {
  22.     
  23.     print "Error saving permissions on target disk.\n";
  24.     
  25. }
  26.  
  27. exit(0);
  28.