In Haskell's Turtle libarary, how to copy a file, but preserve the file date

46 Views Asked by At

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?

1

There are 1 best solutions below

0
chi On BEST ANSWER

It looks like Turtle does not allow that.

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