Friday, June 17, 2011

Change file Modification Date from Perl

Today I had a task to change the modification date of file. In Linux it could be done using command:

touch -m -d "date" filename

But 'touch' command under Mac OS X has different parameters and after using the same command we will get error:

touch: illegal option -- d
usage: touch [-acfm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file