Tuesday, August 21, 2012

Change a file's Last Modified Date and Created Date on Mac OSX

Simple steps on how to change a file’s date modified and date created attributes on Mac OS X.
Date Format Key:
YYYY – The year (the first two digits/century can be omitted).
MM – The month of the year, from 1 to 12.
DD – The day of the month, from 1 to 31.
hh – The hour of the day, from 0 to 23.
mm – The minute of the hour, from 0 to 59.

How to change the date modified attribute of a file?
1. Open up the Terminal.
2. Type this into Terminal (without hitting enter/return) replacing YYYYMMDDhhmm with the desired date information:
touch -mt YYYYMMDDhhmm
3. Open a Finder window and locate the file you wish to modify and drag and drop it into the Terminal window. Here’s an example of what should be typed into the Terminal at this point:
touch -mt 200801120000 /Volumes/Mac\ HD/Pictures/somefile.jpg
200801120000 in the example above represent “January 12, 2008 12:00 AM”. Replace /Volumes/Mac\ HD/Pictures/somefile.jpg with the proper path to the file you wish to alter the date for.
4. If all is in order press the return key.

How to change the date created attribute of a file? Warning: This will change both the date modified and date created attributes.
1. Open up the Terminal.
2. Type this into Terminal (without hitting enter/return) replacing YYYYMMDDhhmm with the desired date information:
touch -t YYYYMMDDhhmm
3. Open a Finder window and locate the file you wish to modify and drag and drop it into the Terminal window. Here’s an example of what should be typed into the Terminal at this point:
touch -t 201212211111 /Volumes/Mac\ HD/Pictures/somefile.jpg
201212211111 in the example above represent “December 21, 2012 11:11 AM”. Replace /Volumes/Mac\ HD/Pictures/somefile.jpg with the proper path to the file you wish to alter the date for.
4. If all is in order press the return key.

How to batch update the date modified attribute of multiple files?
1. Make sure all the files you want to modify are in the top directory of the same folder. Don’t store files in this folder if you don’t want them to be modified.
2. Open up the Terminal.
3. Type this into Terminal (without hitting enter/return) replacing YYYYMMDDhhmm with the desired date information:
touch -mt YYYYMMDDhhmm
4. Open a Finder window and locate the folder containing the files you wish to modify and drag and drop it into the Terminal window. Here’s an example of what should be typed into the Terminal at this point:
touch -mt 200801120000 /Volumes/Mac\ HD/Pictures/Album
5. Add /* to the end of the command. If you’re only targeting a specific file type include its extension (e.g. /*.jpgor /*.png). Your command should look something like this:
touch -mt 200801120000 /Volumes/Mac\ HD/Pictures/Album/*
6. If all is in order press the return key.

How to batch update the date created attribute of multiple files? Warning: This will change both the date modified and date created attributes.
1. Make sure all the files you want to modify are in the top directory of the same folder. Don’t store files in this folder if you don’t want them to be modified.
2. Open up the Terminal.
3. Type this into Terminal (without hitting enter/return) replacing YYYYMMDDhhmm with the desired date information:
touch -t YYYYMMDDhhmm
4. Open a Finder window and locate the folder containing the files you wish to modify and drag and drop it into the Terminal window. Here’s an example of what should be typed into the Terminal at this point:
touch -t 201212211111 /Volumes/Mac\ HD/Pictures/Album
201212211111 in the example above represent “December 21, 2012 11:11 AM”. Make sure to change201212211111 to the date you want and to replace /Volumes/Mac\ HD/Pictures/Album with the proper path to the folder containing the files you wish to alter the date for.
5. Add /* to the end of the command. If you’re only targeting a specific file type include its extension (e.g. /*.jpgor /*.png). Your command should look something like this:
touch -t 201212211111 /Volumes/Mac\ HD/Pictures/Album/*
6. If all is in order press the return key.

Fix damaged RAR file and CRC error - Mac


Firstly download all the files without any interruptions and ensure all the RAR files are of the size as specified on the download site/link. 

Download Mac OSX port of the RAR program,  from http://www.rarlabs.com/download.htm. Decompress the downloaded file.

Open the terminal and drag the file named rar from the decompressed folder to the terminal window. Then make sure there's a space, then type "r" (without the quotes). Then make sure there's another space. Then drop the file you want repaired onto the terminal window (it'll give the path and name of the file). Then make sure there's another space, and type "Users/yourname/Desktop" or wherever you want the fixed file placed. It may be easier to just drag and drop the folder where you want it placed onto the terminal window again so there's no chance at typos.

Then hit "return" and the repair scan will start. if the file has a recovery record, it will say that it was found almost immediately. Then it goes about repairing the file. Depending on the size of the file, it may take a couple minutes.

Note that the file will have the prefix "fixed" appended to the beginning of the filename. You'll need to delete that once the repair process has completed before you attempt to join the files again.