copynewerfile(
SOURCE
,
DESTINATION
)

The copynewerfile( function copies a file to another name or location. However, the file is only copied if it is newer than the old file, otherwise the destination is not touched.


Parameters

This function has two parameters:

source – Path and filename of original file.

destination – Path and filename of copied file.


Description

This fuction copies a file to another name or location. However, the file is only copied if it is newer than the old file, otherwise the destination is not touched.

This example copies the file “Christmas.jpg” to another folder.

let copyStatus = copynewerfile("~/My Drive/Christmas.jpg","~/My Drive/Cards/Christmas.jpg")

If both Christmas.jpg files are the same, this function will return a copyStatus of Identical, and the file won’t be copied. If My Drive/Cards/Christmas.jpg doesn’t exist yet, the function will copy the file and return a copyStatus of New File. If both files exist but the Christmas.jpg in the My Drive folder is newer, the file will be copied and the result will be Updated File.

To see an example of this statement in action, view the source code for the copynewerfolder statement.

This example makes a copy of the file “Raw Data.txt”, which must be in the same folder as the current database.

let copyStatus = copynewerfile("Raw Data.txt","Copy of Raw Data.txt")

See Also


History

VersionStatusNotes
10.2NewNew in this version.