Is it possible that Perl runs Linux with a changed scheduling priority and / or IO without external commands? I am trying to simulate the following:
nice -n19 ionice -c2 -n7 cp largefile largefile2
Is there any way to do this with File :: Copy, the setpriority function and the CPAN module of Linux :: IO_Prio? Would I just have to lower my $ 0 scheduling priority?
EDIT: If I do the following, will priority and IO be omitted for copy ()? Is there a better way to do this?
use Linux::IO_Prio qw(:all); use File::Copy; setpriority(0, 0, -20); ionice(IOPRIO_WHO_PROCESS, $$, IOPRIO_CLASS_IDLE, 7); copy("file1","file2") or die "Copy failed: $!";
source share