IT Community - Software Programming, Web Development and Technical Support

Changing File Access Permissions

This is a discussion on Changing File Access Permissions within the Operating Systems forums, part of the Computer Hardware/Software and Networking category; Changing File Access Permissions in UNIX Every file has following attributes: * owner's user ID ( 16 bit integer ) * owner's ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Computer Hardware/Software and Networking > Operating Systems

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-20-2007, 07:43 AM
vijayanand vijayanand is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 293
vijayanand is on a distinguished road
Default Changing File Access Permissions

Changing File Access Permissions in UNIX

Every file has following attributes:
* owner's user ID ( 16 bit integer )
* owner's group ID ( 16 bit integer )
* File access mode word

'r w x -r w x- r w x'
(user permission-group permission-others permission)
r-read, w-write, x-execute
To change the access mode, we use chmod(filename,mode).
Example 1:
To change mode of myfile to 'rw-rw-r--' (ie. read, write permission for user - read,write permission for group - only read permission for others) we give the args as:
chmod(myfile,0664) .
Each operation is represented by discrete values
'r' is 4
'w' is 2
'x' is 1
Therefore, for 'rw' the value is 6(4+2).
Example 2:
To change mode of myfile to 'rwxr--r--' we give the args as:
chmod(myfile,0744).
__________________

J.Vijayanand
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing dynamically vigneshgets Software Testing 1 11-12-2007 11:30 PM
how to access local file from server? varghese HTML, CSS and Javascript Coding Techniques 5 10-18-2007 12:15 AM
Query about requirements changing simplesabita Software Testing 2 08-29-2007 09:58 AM
Difference between a file and Random access file Classes anbuchezhians Java Programming 1 08-08-2007 02:53 AM
Access e-mail using Outlook Web Access gattuso Server Management 0 07-19-2007 07:20 AM


All times are GMT -7. The time now is 12:49 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0