Skip to content

Instantly share code, notes, and snippets.

@csu

csu/creationdater.sh

Created Aug 31, 2012
Embed
What would you like to do?
Copy creation dates of files from a mirror directory
# Part of the txt-to-dayone repository: https://github.com/christophersu/txt-to-dayone
IFS=$'\n'
files=$(ls | egrep '(.txt)')
for i in $files; do
#get original creation dates
original=$( GetFileInfo -d "$i" )
#change the creation date of the same file in the destination
if [ -e "/Users/christophersu/Desktop/test/$i" ]; then
SetFile -d "$original" "/Users/christophersu/Desktop/test/$i"
fi
done
unset IFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.