JDT

 

FREE Downloads
Articles
Tutorials

 

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:

Permission

Allows

7

Reading, writing and executing the file

6

Reading and writing the file

5

Reading and executing the file

4

Reading the file

3

Writing and executing the file

2

Writing the file

1

Executing the file

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).

Example

chmod 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



Earnings Tracker is John Dixon Technology's FREE open source accounting and bookkeeping software tool.

Earnings Tracker is aimed at contractors and freelancers, and enables you to perform many bookkeeping and accounting tasks, helping you to keep track of your company's earnings and outgoings.

The software is written in PHP and MySQL and is available to use for FREE online, or as a FREE download.

As it is written in open source software, you are free to modify the code yourself, enabling you to produce a customized version of Earnings Tracker that fits your own specification.

Earnings Tracker can also be used simply as a dividend, corporation tax, or VAT calculator.

Need free accounting software
 



JDT

Copyright Notice for John Dixon Technology Ltd

Privacy Statement

Terms & Conditions