Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smooth Operator: Rename a file while writing to it

In Linux (probably also in Windows/OSX) if we open a file to write and while writing to it we rename it, the raku process goes smooth and keeps writing to the file as it should.

But how can we find the new name (path) of the file while the renaming happens?

IO::Notification is NOT the way to go because it gives no other information but only the general description:

FileRenamed or FileChanged

Is there a way to do it?

like image 215
jakar Avatar asked Nov 20 '20 08:11

jakar


1 Answers

Short answer: No, not as far as I know.

Some technical background here: Rakudo on MoarVM (which is the only backend that supports IO::Notification afaik) depends on libuv for this functionality. If libuv doesn't support it, there only a very small chance that Rakudo will.

I have no idea if libuv supports that functionality. If it does, I suggest you make an issue in MoarVM to draw attention to this. Or even better, write a Pull Request to implement that functionality.

like image 75
Elizabeth Mattijsen Avatar answered Oct 17 '22 10:10

Elizabeth Mattijsen