I want to preserve the modification & creation date on files copied using :
set CaptureFilepath to quoted form of (POSIX path of (theFile as text)) as text
set BackupFilepath to quoted form of (POSIX path of (ParentDirinBackup as text)) as text
set complete to do shell script "cp -R -f " & CaptureFilepath & " " & BackupFilepath
Do I have to use “touch” afterwards or is there a way to tell “cp” to do it?
-p Cause cp to preserve the following attributes of each source file
in the copy: modification time, access time, file flags, file mode,
user ID, and group ID, as allowed by permissions. Access Control
Lists (ACLs) will also be preserved.
I guess, these bunch of coercions are not needed,
if CaptureFilepath and BackupFilepath are aliases, this is sufficient
set CaptureFilepath to quoted form of POSIX path of theFile
set BackupFilepath to quoted form of POSIX path of ParentDirinBackup
set complete to do shell script "cp -pRf " & CaptureFilepath & " " & BackupFilepath
if the variables are Finder files, use this
set CaptureFilepath to quoted form of POSIX path of (theFile as text)
set BackupFilepath to quoted form of POSIX path of (ParentDirinBackup as text)
set complete to do shell script "cp -pRf " & CaptureFilepath & " " & BackupFilepath