Restoring files with wrongly updated file-dates

Discussion in 'Mac Apps and Mac App Store' started by macstatic, Jun 27, 2015.

  1. macstatic macrumors 6502a

    Joined:
    Oct 21, 2005
    #1
    For some unknown reason many files on a drive have been updated with their creation and modification dates to June 22nd 2015 even though these are old files. I have no idea why -anyone know what could cause this to happen if I didn't do it myself?

    Anyway I have a backup drive (with their correct dates) but I want to ensure I don't overwrite anything new or edited, so what would the best way be to fix this?
     
  2. Partron22 macrumors 68000

    Partron22

    Joined:
    Apr 13, 2011
    Location:
    Yes
    #2
    Apple's filesystem does this occasionally, to no other apparent purpose than to make it difficult for users to keep track of when their files were created or last modified.
    Creation date is read only under Applescript. Mod date, you can change that way. Both dates may be accessible via Terminal, but as there's typically thousands of files involved, fixing things is a major undertaking.
    Might be best to just periodically print out the creation and mod dates of all your files, so when you need that info, there's a chance you'll be able to find it.
    Remember, as consumers, we're not supposed to care about complicated things like files, and Apple actively encourages use not to by implementing annoying behaviors like this.
     
  3. macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #3
    Yeah, Apple has surely become more of an entertainment company than the computer company it once was :mad:

    The first thing I have to do is probably find out how many and which files are affected by the date change. I've never heard about this happening to anyone else -so it randomly occurs?
     
  4. Partron22 macrumors 68000

    Partron22

    Joined:
    Apr 13, 2011
    Location:
    Yes
    #4
    Might be something going wrong with a Volume header. iTunes and some of the other Apps that keep files in their own database seem to think they have change rights as well.
    Terminal -> Setfile will get you back what you want if it's only a few files.
     
  5. MacTech68 macrumors 68000

    MacTech68

    Joined:
    Mar 16, 2008
    Location:
    Australia, Perth
    #5
    I've noticed TechToolPro do this when optimizing files. I wonder if MacOS X's own file optimization mechanism does the same thing?

    It's pretty annoying if you use modification date to track a file's history/legacy.
     
  6. Partron22 macrumors 68000

    Partron22

    Joined:
    Apr 13, 2011
    Location:
    Yes
    #6
    I've taken to prepending/appending a date string to file names where I care about this. It can be a PITA sortwise.
    If Apple's going to use these dates for non-consumer purposes, they should make them invisible, so as to not to mislead people into thinking that the info can be relied upon.
     
  7. macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #7
    From what I understand this allows you to copy the modification date over to the creation date, but in my case I've messed it all up so there's no correct modification date to copy from.
    Having investigated it further it might seem like I've accidently messed it up using an app such as "A Better Finder Attributes" or similar, but it does seem a bit odd that I would do something like that without noticing.

    MacTech68: you're only talking about the modification date here, right? I agree it's a PITA, but I could live with that. My issue is that the Creation dates are also messed up in lots of photos, so I don't know any longer when they were shot. Perhaps restoring them from backups is the only way to solve this (time consuming!).
     
  8. MacTech68 macrumors 68000

    MacTech68

    Joined:
    Mar 16, 2008
    Location:
    Australia, Perth
    #8
    I've not investigated what happens to the creation date, but I have a vague recollection that both are modified to the current date.

    Regarding your dilemma, do the photos contain exif data to be able to extract the date taken and apply it to the creation & modification date via a batch process?
     
  9. Partron22 macrumors 68000

    Partron22

    Joined:
    Apr 13, 2011
    Location:
    Yes
    #9
    If these are photo files, this AppleScript, properly modified with some shell scripting added (Setfile) might be able to restore file dates for you enmasse: Extracting Metadata
    Created and modified dates are part of the metadata on my image files.

    I didn't look hard, but it's a common enough problem that someone may have written a script/Automator action that does exactly what you need.
     

Share This Page