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?

halloleo
  • 9,216
  • 13
  • 64
  • 122
  • 2
    I don't think this is possible with Turtle. Maybe you could try [copyFileWithMetadata](https://hackage.haskell.org/package/directory-1.3.8.1/docs/System-Directory.html#v:copyFileWithMetadata) instead. – chi May 09 '23 at 07: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. – halloleo May 10 '23 at 23:10

1 Answers1

1

It looks like Turtle does not allow that.

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

halloleo
  • 9,216
  • 13
  • 64
  • 122
chi
  • 111,837
  • 3
  • 133
  • 218