-
Perl/Tk question
I need to make a program in perl to be user initiated. Well I could make it in anything but I want to do it using perl/Tk
Im making it where it requires the user to enter the name into box (so they feel responsible) then compress and transfer the contents of a directory by ftp. this part is easy.
Here’s the problem. They want me to put a progress bar on it so the person waiting for the transfer to complete (to go home) will not think the program is stuck and just leave. Some of the files are 20 - 30Mb and can take some time.
The progress bar itself is no problem but I cant seem to find out how to read the header for the total file size then count the bytes sent and put that count into a scalar. Any body have any thoughts on this?
-
getting filesize is easy...
Code:
$size=(stat($file))[7]; #in bytes
as for the other part, are you using the Net::FTP module? and would prolly have to modify that- but then you would also need to ship the FTP module as well as your script...
-
whatever i modify will ship. im packaging via perl2exe. but i guess its back to the drawing board....thanks!
-
This may be a silly question, but why not just turn the hash function on before you send the file?
/nebulus