in reply to Re: Logic-Based Permission Check
in thread Logic-Based Permission Check

Use the built-in chmod command rather than system calls. The first element in the list must be un numerical mode and must be an octal number (and not a string containing the number). Also, contrary to what you would do at the shell prompt under U*ix, don't forget the comma between the mode and the list of files (I once wasted half an hour before I figured out that).

In brief, the typical syntax should be something like this:

chmod 0755, $file1, $file2, "foo.txt";

Check also for the chown function.