forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Creating Progress Bar for Single Large File

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
kenmcn816
Newbie


Joined: 26 Mar 2003
Posts: 6

PostPosted: Fri Mar 28, 2003 7:11 pm    Post subject: Creating Progress Bar for Single Large File Reply with quote

Is there a way to create a progress bar for a single large file (around 800 MB) to be copied from a network drive to a local hard drive. I want to mirror the Windows File Copy dialog box that I want it to show the progress of the file being copied and an estimation of time. I have been told I can't accomplish this under VDS using the FILE copy command, because the next line won't be processed until the file copy operation is completed. I have been told I would have to use a Windows API call to accomplish what I'm after. Is there an easy way to do this? Any help anyone could give me would be great, thanks.
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Mar 28, 2003 8:22 pm    Post subject: Reply with quote

I believe what you're looking for was already discussed:
http://www.vdsworld.com/forum/viewtopic.php?t=1172

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
kenmcn816
Newbie


Joined: 26 Mar 2003
Posts: 6

PostPosted: Fri Mar 28, 2003 10:00 pm    Post subject: Reply with quote

I read the code that was contained in the previous message, however I still have a few questions. I understand that the loop will repeat until the progress reaches 100% and then go back to the :Evloop where it will wait for user input. The question I have is would the FILE Copy command allow the loop to continue or would the loop stop processing until the copy command was completed? Would you have to make the FILE Copy command the event in which to create the loop? This would create almost a nested loop in which the copy command was inside the progress bar loop. I don't know if this is feasible or not that is why I thought a Windows API call would need to be used in order to accomplish this.
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Mar 28, 2003 11:54 pm    Post subject: Reply with quote

VDS doesn't multi-thread - once it starts a file copy it stays on
that line until finished.

The alternative is another EXE to monitor it, or another FILE COPY
routine (such as DOS copy, or a VDS prog that only copies) that ya
can call, then monitor from your original VDS prog (this would be my
choice - I like PGWARE's idea as well).

About the loop - you need a finished file size to check for, and when
the destination file reaches that size, it's done. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Mar 29, 2003 12:03 am    Post subject: Reply with quote

Found an old DOS copy routine with a progress bar - might give
ya some ideas. Wink

http://www.vdsworld.com/archive/index.php?page=topic&board=3&topic=139

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
iMPA
Newbie


Joined: 26 May 2001
Posts: 9
Location: Spain

PostPosted: Sat Mar 29, 2003 12:06 pm    Post subject: Reply with quote

Hi kenmcn816!
this is an example of copying files using binfile and @binfile... it a little slow nor it works...
the code makes a copy of vdsrun40.dll from your windows\system directory to the script folder
hope that helps...

Code:

title file copy progress bar
  DIALOG CREATE,copy progress bar,-1,0,240,55
  DIALOG ADD,PROGRESS,PROGRESS,5,5,230,24,0
  DIALOG ADD,STATUS,STATUS
  DIALOG SHOW
 
  %%filein = @windir(s)\vdsrun40.dll
  %%fileout = @path(%0)\vdsrun40.dll.bak

rem open de origin file
binfile open,1,%%filein,read

rem open the destination file
binfile open,2,%%fileout,create


rem seek the read position to zero
%%pos = 0
rem set a read offset value
rem please test different values for different speeds...
%%inc = 1024
rem start the copy routine
while @not(@binfile(eof,1))
     rem read from file
     binfile seek,1,%%pos
     %%data = @binfile(read,1,hex,%%inc)
     rem write to file
     binfile write,2,hex,%%data
     rem seek to another position
     %%pos = @sum(%%pos,%%inc)
    
     rem calculates the percentage
     %p = @fmul(@fdiv(%%pos,@binfile(size,1)),100)
     dialog set,progress,@format(%p,3.0)
     dialog set,status,%p %
wend

rem close both files...
binfile close,1
binfile close,2

info operation completed !!


sorry for my poor english

_________________
share what you know, learn what you don't
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ACE
Valued Newbie


Joined: 05 Sep 2002
Posts: 34

PostPosted: Sat Mar 29, 2003 9:32 pm    Post subject: Reply with quote

sorry but the monitoring idea was mine

Mad

Lioric
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Mar 30, 2003 12:49 am    Post subject: Reply with quote

ACE wrote:
sorry but the monitoring idea was mine

Mad

Lioric

ACE, not sure who you're addressing that remark to - but if
you check the link I posted, it monitors the DOS file copy
routine and is dated 07-24-2001.

I mentioned PGWARE's idea because he suggested re-calling
the same EXE with parameters, which saves the need for an
additional EXE.

I don't think anyone is trying to take credit for your ideas. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
kenmcn816
Newbie


Joined: 26 Mar 2003
Posts: 6

PostPosted: Mon Mar 31, 2003 9:09 pm    Post subject: Reply with quote

I wanted to thank everyone who responded. I have alot of good ideas to get started on making this work. Mac I really like your idea using the DOS copy command, and I will start there. I don't think there should be an issue even though we are using Windows XP, because the drive we will be copying to is a FAT32 drive.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group