Batch copy time creation and modification date from files using OSX
Since this is not working for you I'm going to suggest you do as fd0 suggested and use SetFile
. This will be used in conjunction with GetFileInfo
, both of which are a part of Command Line Tools for Xcode.
You do not need to install the Xcode.app which is ~3.80 GB, just ~160 MB for Command Line Tools for Xcode.
In Terminal: xcode-select --install
See How to Install Command Line Tools in OS X Mavericks & Yosemite (Without Xcode), which is also for OS X El Capitan.
Here is a bash script to use with SetFile
and GetFileInfo
:
#!/bin/bash
for f in *; do
if [[ -f $f ]] && [[ ${f##*.} == MXF ]] && [[ -f ${f%.*}.mov ]]; then
cDate="$(GetFileInfo -d "$f")"
mDate="$(GetFileInfo -m "$f")"
SetFile -d "$cDate" -m "$mDate" "${f%.*}.mov"
fi
done