Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

progressbar with copy files

Status
Not open for further replies.

channelmaster

Technical User
Dec 9, 2001
52
PH
How can I make a progressbar to work with copy file to? An example of this is using copy files mysource to mydestination. What value will I place at the progress bar.
thanks
 
channelmaster

Too difficult to guesstimate the size of the file. Try using the copy.avi.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
channelmaster

I would go with Mike's suggestion and play an .avi file - only certain processes lend themselves to be monitored by a progressbar.

If you consider such information important, you can also advise the user of the increase in size of the files being copied by adapting the following code which monitors the size of an .fpt file which is being extracted from a .zip file.

The principles would be the same in that you would be constantly checking the size of the file and reporting in the wait window together with the filename.

lnSize = 0
DO WHILE .T. && Wait for extract to complete
[tab]lnNo = ADIR(laMemo,ADDBS(GETENV([TEMP]));
[tab][tab]+ [currproj.fpt])
[tab]IF lnNo > 0
[tab][tab]lnSize = laMemo[2]
[tab][tab]WAIT WINDOW [Unzipping project files];
[tab][tab][tab]+ CHR(13);
[tab][tab][tab]+ CHR(13);
[tab][tab][tab]+ ALLT(TRAN(CEIL(laMemo[2]/1.048576/1000),999,999]));
[tab][tab][tab]+ [KB bytes copied] NOWAIT NOCLEAR
[tab][tab]ADIR(laMemo,ADDBS(GETENV([TEMP]));
[tab][tab][tab]+ [currproj.fpt])
[tab][tab]IF lnSize > 0 AND lnSize = laMemo[2]
[tab][tab][tab]EXIT
[tab][tab]ENDI
[tab]ENDI
ENDD
FAQ184-2483 - the answer to getting answered.​

Chris [pc2]
 
Thanks for tha advice, but what I have in mind is to make a progressbar during backup purposes. I used copy file c:\mydata\*.* to c:\mybackup\*.* for my backup. It would be nice if a progressbar will be shown. Thanks for any advice you can give. God bless!
rene
 
Rene,

I used copy file c:\mydata\*.* to c:\mybackup\*.* for my backup

If that's the point, you can use the total number of files beeing copied as the value for the divider. You can use the LISTBOX and set it's RowSourceType to 7-Files.

Good luck!
 
channelmaster

'copy files mysource to mydestination' - I read it, and it seems Mike did as well, that you were copying a single file.

If you are copying multiples files, then you do have data which will enable you to calculate progress.

You can use ADIR() on the source folder to obtain total number of files to copy, and ADIR() in a loop on the target folder to give you no of files copied.
FAQ184-2483 - the answer to getting answered.​

Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top