JDT |
FREE Downloads |
|
Changing File Permissions in Perl |
||||||||||||||||||||
|
chmod is a Unix command that sets the permissions on files. For example, to change a file's permissions to 755, you would type at the command line: chmod 755 <filename> (File permissions in Unix are known as 'mode', so chmod means 'change mode'.) Each of the three digits represents one set of permissions. The first number if for the owner of the file, the second is for the group to which the file belongs, and the third is for everyone else. Here is a table showing the permissions that each digit represents:
You can change the permissions on multiple files at the same time by using the command: chmod mode, <list of files> The mode must be a four digit number beginning with a zero (this is because it is a literal octal number). Examplechmod 0754, 'file1.pl'; This grants read (R), write (W), and execute (X) permission to the file's owner, read (R) and execute (X) permission to everyone in the group to which the file belongs, and read (R) permission to everyone else. Go back to Perl Tutorials home page Go back to Tutorials home page
|
|