Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I set a file's creation date as the modified date?

e.g. File is made on Monday, edited on Tuesday. On Wednesday I want the date modified and date created to be set to Tuesday.

Thanks!

share|improve this question
1  
Which Apple OS are you running? OS X runs on top of Unix and Unix file systems do not track the creation date. –  garyjohn Aug 28 '11 at 1:54
    
@garyjohn OS X has separate Created dates and Modified dates in the get info box... not sure what you mean. –  Vervious Aug 29 '11 at 4:20
    
@Nano8Blazex: I guess I mean I have a limited understanding of OS X. From a little Googling it appears that OS X does track the creation time but that not all programs access it. Harry Fear: You might find this program useful: hamsoftengineering.com/codeSharing/ChangeFileDates/…. –  garyjohn Aug 29 '11 at 5:20
add comment

1 Answer

f=test.txt
SetFile -d "$(GetFileInfo -m "$f")" "$f"

GetFileInfo and SetFile are part of the command line tools package, which can be downloaded from developer.apple.com/downloads or from Xcode's preferences after installing it from the App Store.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.