Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-06-2003, 04:22 PM   #1
Ian Knight
LQ Newbie
Registered: May 2003
Posts: 1

Rep: Reputation: 0
How to set file creation time in Linux


Iím new to Linux (Redhat) and just started C programming on it today, however I do have many year of C on other platforms.

What Iím writing is a file copy utility that will recures down a directory tree and copy files into a single directory. However, I when I create/open the new file to write in, I wish to preserve the file creation time of the original file. Now I have found the utime() function that will allow me to change the access and modified times but canít find a function to set the file creation timeÖ Can you help please.

Brgds Ian Knight
Old 05-06-2003, 05:47 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
I'd recommend grabbing the source for
GNU fileutils and have a close look at
cp.c ... because if used with the -p
flag it manages to copy a file and preserve
the creation time :)



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash: how to get time (in seconds) elapsed since creation of a file? J_Szucs Linux - General 6 12-27-2008 11:28 PM
list file creation time allelopath Linux - General 2 08-02-2005 09:02 PM
Set time in linux jasone Linux - General 2 05-24-2005 01:44 AM
How to set default file creation pembo13 Linux - Security 6 07-02-2004 10:44 PM
Time of creation of a file proxyserver Linux - Software 2 04-11-2004 10:29 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:36 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration