APM: chmod doesn't die

Goldilox Goldilox at teachnet.edb.utexas.edu
Mon Apr 28 11:36:39 CDT 2003


this script keeps dieing. the chmod failsafe is not working and the chmod fails
everytime (since the files were uploaded by the site owner via ftp and are not
owned by Perl? those files are all 0644 before this script runs). Do I need to
have Perl take ownership of the files to be able to chmod them (the files are
picture files)? But more importantly, why does the chmod fail and then continue
on as if it hasn't failed? Let me know if I am not providing enough info (This
is perl, v5.8.0 built for aix)

Thanks again

Rhett


#!/usr/bin/perl
use CGI;
$cg=new CGI;


$thumbsfile="/path";
chmod 0766,$thumbsfile || no_way();#die "Can't chmod 766 $thumbsfile: $!";
unlink ($thumbsfile) || die "Can't unlink $thumbsfile: $!";

print $cg->redirect("/path");

sub no_way{print $cg->header;print qq~<html><head><title>Feature Not
Available</title>
<meta name=refresh http-equiv=refresh content="5;url=/path">
</head><body bgcolor=white>
<p>This feature is not available. Please send an email to the <a
href="mailto:">webmaster</a> requesting this feature.</p>
<p><a href="javascript:history.go(-1);">Go back</a> or wait and this page will
automatically take you somewhere.</p></body></html>~;exit(0);}




More information about the Austin mailing list