I have a line like dd if=/dev/zero of=myImg.img bs=1KB count=1024k
, which I have to do several times in my script. Therefore i wanted to integrate this line in my perl script, not by doing a system('...');
call, but by creating a funktion. Is there a good way to do so?
I've tried it with MakeMaker, but i didn't find a proper way to set my filelength/offset the right way, or anything similar to the -o -l
from fallocate
.
And of course, the obvious way open(FH,">/myFolder/MyImg.img");
didn't work, either.