Thread: Change file date created or modified (linux/unix/osx)

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    8

    Change file date created or modified (linux/unix/osx)

    Howdy,

    I'm trying to modify the date modified or created compiling under linux/unix/osx. What library do I need for that?

    Kind regards, Maarten

  2. #2
    Registered User
    Join Date
    Jan 2009
    Posts
    1,485
    utimes() in sys/time.h seems like a fit. From the man page:

    int
    utimes(const char *path, const struct timeval times[2]);

    DESCRIPTION
    The access and modification times of the file named by path or referenced by fildes are changed as specified by the argument times.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Get last modified date and time
    By Babkockdood in forum C Programming
    Replies: 2
    Last Post: 10-22-2011, 06:22 PM
  2. Help: Finding only Last modified file or Created file
    By lagrz in forum C++ Programming
    Replies: 3
    Last Post: 01-03-2006, 04:49 PM
  3. Date Last Modified
    By magic.mike in forum Windows Programming
    Replies: 5
    Last Post: 09-23-2005, 05:13 AM
  4. Replies: 2
    Last Post: 10-08-2002, 09:31 AM
  5. Last modified date?
    By Hoxu in forum C++ Programming
    Replies: 3
    Last Post: 11-15-2001, 12:32 PM