change file information

This is a discussion on change file information within the Linux Programming forums, part of the Platform Specific Boards category; Hello, Using stat() you can retreive information about a file, is there a similar function to or way to set ...

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    19

    change file information

    Hello,

    Using stat() you can retreive information about a file, is there a similar function to or way to set the values? If you modify a value in the stat structure that you populate, can you write it back to the file?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    Well there are specific API calls like chmod / chown to update specific things, but there isn't a single API to allow you to change things arbitrarily.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    2,421
    if you want to modify the access/modify times, you can try the utime() function.

  4. #4
    Registered User
    Join Date
    Sep 2011
    Posts
    19
    Thanks Ill take a look at utime()!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Information from a file and structs?
    By equitrainer86 in forum C Programming
    Replies: 0
    Last Post: 03-02-2010, 06:42 PM
  2. how to get information about a file
    By luca in forum C++ Programming
    Replies: 5
    Last Post: 05-15-2007, 09:37 AM
  3. File Information
    By Scarvenger in forum Windows Programming
    Replies: 3
    Last Post: 08-26-2006, 05:02 PM
  4. MP3 File Information
    By Marc in forum C++ Programming
    Replies: 2
    Last Post: 11-20-2003, 04:13 PM
  5. File information in C
    By jakewendt in forum C Programming
    Replies: 2
    Last Post: 10-11-2002, 04:12 PM

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