Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it posible not to change the filedate. #41

Open
Anderman opened this issue Jun 17, 2024 · 3 comments
Open

Is it posible not to change the filedate. #41

Anderman opened this issue Jun 17, 2024 · 3 comments

Comments

@Anderman
Copy link

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

@qetza
Copy link
Owner

qetza commented Jun 18, 2024

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.

@Anderman
Copy link
Author

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);
}
``

@qetza
Copy link
Owner

qetza commented Jul 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants