changing file permission of a file

This is a discussion on changing file permission of a file within the Linux Programming forums, part of the Platform Specific Boards category; I want to display and then change file permission of a file whose name is available to me but i ...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    38

    changing file permission of a file

    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?

  2. #2
    still a n00b Jaguar's Avatar
    Join Date
    Jun 2002
    Posts
    187
    >> I want to display
    $ ls -l filename

    >> i have to use chmod or not
    Yes

    Consult `man -a chmod' or links here.
    Same thing. But you must have permission to do that.
    Last edited by Jaguar; 09-23-2003 at 11:39 AM.
    slackware 10.0; kernel 2.6.7
    gcc 3.4.0; glibc 2.3.2; vim editor
    migrating to freebsd 5.4

  3. #3
    Registered User
    Join Date
    Sep 2003
    Posts
    38

    Unhappy But...

    But i want to do that all in a c program and using gcc!

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231

    Re: But...

    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
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #5
    still a n00b Jaguar's Avatar
    Join Date
    Jun 2002
    Posts
    187
    `man 2 chmod' probably help you, isn't it?
    slackware 10.0; kernel 2.6.7
    gcc 3.4.0; glibc 2.3.2; vim editor
    migrating to freebsd 5.4

  6. #6
    Registered User
    Join Date
    Jan 2003
    Posts
    88
    a lot of UNIX commands are also functions in C.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 11:39 PM
  2. tmpnam() : permission denied when try to open temp file
    By happyclown in forum C Programming
    Replies: 3
    Last Post: 03-17-2009, 12:48 AM
  3. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 04:53 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 11:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21