in reply to File copy progress.
The code prints out that it has done 100% twice ;-) this is probs bad.. Hows about changing it to show the bytes read / bytes left to read. This would also allow you to change the block size for larger files. The simplest way to do this would be to incr a variable after the sysread and print that rather than the percentage. I could not see why it was printing 100% twice but I did not look hard.
On a stylistic point, why did you use a sub to print out the message, and why did you pass that sub as an arg? Just interested to hear your rational.
Nice little bit of code, ++, I have added it to my personal repository of bits of useful stuff .. nice one.
--
Zigster
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: File copy progress.
by zzspectrez (Hermit) on Dec 05, 2000 at 19:00 UTC | |
by zigster (Hermit) on Dec 05, 2000 at 19:09 UTC | |
by zzspectrez (Hermit) on Dec 06, 2000 at 05:27 UTC | |
by Kanji (Parson) on Dec 06, 2000 at 07:03 UTC | |
by zzspectrez (Hermit) on Dec 06, 2000 at 10:41 UTC | |
|
In Section
Seekers of Perl Wisdom