Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Unix&Linux>>Change modification time

Change modification time

ceashton
08-31-2005, 06:15 AM
Hi all,

When I dump my photographs on my mac some of them need rotating. Rotating changes the modification time, from the creation date to the current system date. This means that when I want to view the photos in ACDSee, the chronological order isn't preserved. I could view them in name order which solves the problem when I am just viewing my photos, but as soon as photos originating from a different camera (with different naming convention) are thrown into the mix, I view one set originating from one camera and then a second originating from the second camera.

I would like to view the files in the order in which they were created rather than modified. Is there a way to change the modify time to the created time?

I believe touch is capable of this, if I can access the create time.

Thanks

Chris

hayne
08-31-2005, 12:16 PM
I believe touch is capable of this, if I can access the create time.
You could get the creation time by parsing the output of '/Developer/Tools/GetFileInfo' (installed along with XCode)

assuna
09-01-2005, 09:26 AM
hi ceashton and hayne
some time ago i posted a question here about changing creation and modification time of files. i wanted to create a script that changes the year of the creation/modification time. the reason for this was a crash on a harddisk, that changed all the residing file's creation and modification times to 28 years in the future...
i got some hints and went digging on. i found out that the gui layer of macos x treats modification and creation times differently than the unix layer.
an example:

finder tells me:
created 8. Sep. 2000
changed 8. Sep. 2000

stat -x (shell utility) tells me:
Access: Thu Sep 1 15:51:28 2005 (this is now, as i am accessing it with stat)
Modify: Fri Sep 8 14:41:00 2000
Change: Wed Aug 31 23:05:55 2005

GetFileInfo tells me:
created: 09/08/2000 14:41:00
modified: 09/08/2000 14:41:00

perhaps i do not get the point what is the difference between "change" and "modification". can someone explain?

anyway: if you want to change modification time with touch, you can do:

touch -t ccyymmddhhMM[ss] dragyourfilefromfinderwindowhere
ccyymmddhhMM[ss] means a string of numbers that represent the new date:
cc=century (eg. 20)
yy=year (eg. 05)
mm=month (eg. 09)
dd=day (eg. 01)
hh=hour (eg. 15)
MM=min. (eg. 23)
[ss]=sec. (eg. 20) not necessary!
alltogether: 200509011523, this is today.


hope it helps!


 

TOP

Windows Server Outsell
Unix Signals And C++ E

For more info

Unix Signals And C++ E
Windows Server Outsell
ssh setup for password
Bash script does not w
esc code 
ARD send unix command 
question about binarie
Scanning mail 
Issuing multiple comma
How do I install Linux

News Archive

/etc/hosts? 
Manually Start a Start
mounting missed hard d
Using Netinfo in Singl
darwin/bsd login probl
system_profiler and fi
Send mail from script 
mounting a drive 
OS X disk first aid ha
system.log shows steal

Related stories:

which online man pages for 10.4 ?
rm command that includes dot-files?
file attributes
Script to copy AND encode Audio CD
Represent ?symbol in command line?
Regular expressions: find paragraphs not containing??
Installing Freevo on OS X
Basic Unix question - help "jobs" command

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics