changing file permission of a file [Archive] - C Board

PDA

View Full Version : changing file permission of a file


Lord CyKill
09-23-2003, 10:03 AM
I want to display and then change file permission of a file whose name is available to me but i dont know that whether i have to use chmod or not!
Ne help?

Jaguar
09-23-2003, 10:37 AM
>> I want to display
$ ls -l filename

>> i have to use chmod or not
Yes

Consult `man -a chmod' or links here (http://www.rt.com/man/chmod.1.html).
Same thing. :) But you must have permission to do that.

Lord CyKill
09-23-2003, 10:43 AM
But i want to do that all in a c program and using gcc!

Hammer
09-23-2003, 10:54 AM
Originally posted by Lord CyKill
But i want to do that all in a c program and using gcc!
Code version:
http://www.rt.com/man/chmod.2.html
http://www.rt.com/man/stat.2.html

Jaguar
09-23-2003, 10:55 AM
`man 2 chmod' probably help you, isn't it?

lithium
09-23-2003, 09:44 PM
a lot of UNIX commands are also functions in C.