Preserve attributes when copying a file in Raku

Viewed 91

On the cli, in linux, cp -p preserves the modified/accessed timestamps on a file. Is it possible to do the same directly in Raku?

The Rosetta example uses Nativecall and it could be done with a system call but looks like these timestamps are only readable in Raku. Am I missing something?

1 Answers

This operation is supported at the virtual machine level by the nqp::copy op, which eventually goes down to MVM_file_copy at the MoarVM level, which defers to the equivalent operation in libuv, which, well, it does not support that, as pointed out in this nodejs issue. So no, you're not missing anything, except maybe copy could be better documented.

Related