How to set Creation date for file...
Hi
Query: How to set the file time...if anybody knows help me..
Reply : For Unix and Mac, you may want to look at utime(). Bring up a terminal window and type: man utime
Query: when i use UTime it change only Access time and Modification Time ....But we cannot change the created date and time....UTime function second argument struct change only Access and Modified date.....But I want to change the Created date.....
if anybody have idea help me....
Re: How to set Creation date for file...
It is not logical to have the possibility to change the created time stamp. What is the use for that, if the file was already created?
A workaround is to delete the file and then create it again. This is one way to reset the created time.
Re: How to set Creation date for file...
Quote:
Originally Posted by
marcel
It is not logical to have the possibility to change the created time stamp. What is the use for that, if the file was already created?
A workaround is to delete the file and then create it again. This is one way to reset the created time.
we r using FSCreateFile and FWWriteFork Mac API to create the file and write the file...We have already creation date data of file...But whenver i m creating this file its date will be current date....But I have to set the Original created date of file from list....so that i want to set the set the created date of file....
Re: How to set Creation date for file...
As marcel said, creation date does what it says: describe the date when the while was created. If someone could change that value, the value would be useless. Its like being able to change the uptime of a linux machine or being able to modify the mileage of your car.
Re: How to set Creation date for file...
Quote:
or being able to modify the mileage of your car.
That is possible and some people do that :)
Re: How to set Creation date for file...
Quote:
we r using FSCreateFile and FWWriteFork Mac API to create the file and write the file...We have already creation date data of file...But whenver i m creating this file its date will be current date....But I have to set the Original created date of file from list....so that i want to set the set the created date of file....
if you really want to do it, then set the time back to the creation date you already have and create the file.
Re: How to set Creation date for file...
Quote:
Originally Posted by
marcel
That is possible and some people do that :)
The same applies to uptime :)
Re: How to set Creation date for file...
Quote:
Originally Posted by
wysota
The same applies to uptime :)
Without modifying the kernel sources?
Re: How to set Creation date for file...
Quote:
Originally Posted by
momesana
Without modifying the kernel sources?
Of course. Never underestimate the power of the Dark Side ;)
Re: How to set Creation date for file...
I think so. I think it could be done with a kernel module, but I don't exactly know how.
I'm looking for the uptime sources right now.
I believe it can be done if the kernel module will replace the functional part of the kernel that is used by uptime to report at least the uptime.
Re: How to set Creation date for file...
There are surely easier ways, but /proc/kcore and gdb are a crude/h4x0r way to do it too.