0

I copy a file with the Turtle library. I do so like this:

...
    do
        TU.cp oldname newname
...

However this sets the date of the copied file to the current time - how can I keep the original date as a shell would do with cp -p?

2
  • 2
    I don't think this is possible with Turtle. Maybe you could try copyFileWithMetadata instead. Commented May 9, 2023 at 7:52
  • @chi Works! Would you mind writing it up as an answer? I know I asked for a way with Turtle but this is probably the next best thing. Commented May 10, 2023 at 23:10

1 Answer 1

1

It looks like Turtle does not allow that.

You can however use copyFileWithMetadata in System.Directory (part of base) instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.