more useful options | |
PerlMonks |
Re^3: Super simple progressby davido (Cardinal) |
on Dec 30, 2019 at 17:21 UTC ( [id://11110774]=note: print w/replies, xml ) | Need Help?? |
Fair enough, so you need a sort of "I'm still doing something" row of dots that emerges as work progresses. It's a little unfortunate how File::Copy::Recursive implements recursion in dircopy. I mean it works great, but it's hard to hook into. However, the dircopy subroutine calls fcopy which is easier to wrap. So this seems to work as I had hoped:
I'm wrapping the fcopy function, which dircopy calls by adding a sub that fires off after each fcopy call. The wrapper prints a dot and flushes STDOUT. One warning: This depends on an implementation detail of dircopy. There are no guarantees the module's author couldn't change how dircopy works, rendering this broken. Dave
In Section
Seekers of Perl Wisdom
|
|