Hi:
I've just moved a number of files to a new directory. Problem is that the files are CHMOD 0644 whereas they need to be 0666. I could FTP and CHMOD them file by file but there are over 300 files to do!
To that end, I created the following script to do the job:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html>\n\n";
print "CHMODing Backup Files... ";
opendir (DATA, "/home/serve/topsite/scripts/top50/backup/");
@filenames = grep (!/^\.\.?$/, readdir (DATA));
closedir (DATA);
foreach $i (@filenames) {
chmod(0666, "/home/serve/topsite/scripts/top50/backup/$i");
}
print "Complete.<p>\n\n";
exit;
The script executes flawlessly but upon inspection, the files are still 0644.
Huh?
Dan
I've just moved a number of files to a new directory. Problem is that the files are CHMOD 0644 whereas they need to be 0666. I could FTP and CHMOD them file by file but there are over 300 files to do!
To that end, I created the following script to do the job:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html>\n\n";
print "CHMODing Backup Files... ";
opendir (DATA, "/home/serve/topsite/scripts/top50/backup/");
@filenames = grep (!/^\.\.?$/, readdir (DATA));
closedir (DATA);
foreach $i (@filenames) {
chmod(0666, "/home/serve/topsite/scripts/top50/backup/$i");
}
print "Complete.<p>\n\n";
exit;
The script executes flawlessly but upon inspection, the files are still 0644.
Huh?
Dan