🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Magnus Byne Mon, 02 Nov 1992 13:01
VBasic, copying files?
#15
Author: Magnus Byne
Date: Mon, 02 Nov 1992 13:01
26 lines
1287 bytes
Hello,

I was trying to write a program in visual basic that had to be able to copy
large binary files.

I tried writing a procedure to do it, but it was very very slow.

I tried using the shell command and xcopy, but it was abit messy as the
screen goes all blact and it leaves windows to it, also its hard to get
the results of wether the file was actually coped or not.

So my question is:

Is there an effiect way to copy large files from visual basic for windows?

Has anyone written a DLL for doing this?

Any suggestions appreciated,

Thanks,

--
--------------------------------------------------------------------------------
|  Magnus Byne, Trinity College, Dublin, Ireland. Email: jhbyne@unix1.tcd.ie  |
|           I used to be indecisive, now I`m not so sure.                     | 
-------------------------------------------------------------------------------
Re: VBasic, copying files?
#16
Author: Brian Wheeler
Date: Mon, 02 Nov 1992 14:35
57 lines
2266 bytes
In <jhbyne.720709286@unix1.tcd.ie> jhbyne@unix1.tcd.ie (Magnus Byne) writes:

>Hello,

>I was trying to write a program in visual basic that had to be able to copy
>large binary files.

>I tried writing a procedure to do it, but it was very very slow.

>I tried using the shell command and xcopy, but it was abit messy as the
>screen goes all blact and it leaves windows to it, also its hard to get
>the results of wether the file was actually coped or not.

>So my question is:

>Is there an effiect way to copy large files from visual basic for windows?

>Has anyone written a DLL for doing this?

>Any suggestions appreciated,

>Thanks,

>--
>--------------------------------------------------------------------------------
>|  Magnus Byne, Trinity College, Dublin, Ireland. Email: jhbyne@unix1.tcd.ie  |
>|           I used to be indecisive, now I`m not so sure.                     | 
>-------------------------------------------------------------------------------

	A routine like this should help you (I used it for a decoder program)
dim chunk as string * 512
dim char as string*1
open "file1" for binary as #1
open "file2" for binary as #2
length=lof(1)
num = length\512
rest = length-num
for a=1 to num
	Get #1,,chunk
	Put #2,,chunk
next a
for a=1 to rest
	Get #1,,char
	Put #2,,char
next a
close #2
close #1

For some reason, it is faster to grab large chunks, than it is to grab a bunch
of small chunks.

Hope this helps
-- 
******************************************************************************
* Brian 'Nautical' Wheeler - These are my opinions, do you hear me?  MINE!
* "Wombats are our friends" - Me
******************************************************************************
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads