Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preserve attributes when copying a file in Raku

Tags:

raku

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?

like image 493
MorayJ Avatar asked Dec 31 '20 14:12

MorayJ


Video Answer


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.

like image 198
jjmerelo Avatar answered Nov 13 '22 13:11

jjmerelo