haskellfile-iocphaskell-turtle

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


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?


Solution

  • It looks like Turtle does not allow that.

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