Open Anderman opened 1 month ago
Hi @Anderman, It's the system that is automatically changing the last modified date so I have no way to avoid this. I will review the code to make sure that the file is not written if there is no changes though.
You can do something like this in your index.js Probably you can make it optional
if (counters.tokens > 0) { // write updated content if tokens where found const { atime, mtime } = await fs.stat(input); await fs.writeFile(output, iconv.encode(result.content, file.encoding, { addBOM: options.addBOM })); await fs.utimes(output, atime, mtime); } else if (input !== output) { // copy original file as binary if not token found await fs.copyFile(input, output); } ``
Hi @Anderman, I think for this specific scenario i'll let people do it through scripting outside of the task as the files are modified so it's normal to change the file dates.
You could have a pre script which records the dates of the files and the a post scripts which would reapply the dates.
Robo copy sees this as a new file. This also give problems in a webfarm where a small part is deployed to a shared folder