🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.basic
Article #16

Re: VBasic, copying files?

#16
From: 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
******************************************************************************
Technical Details
Message-ID: <Bx3F7C.Iy2@usenet.ucs.indiana.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!usc!sol.ctr.columbia.edu!usenet.ucs.indiana.edu!silver.ucs.indiana.edu!bdwheele
References: <jhbyne.720709286@unix1.tcd.ie>

Show Full Headers
Complete Article Headers
Newsgroups: alt.lang.basic
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!usc!sol.ctr.columbia.edu!usenet.ucs.indiana.edu!silver.ucs.indiana.edu!bdwheele
From: bdwheele@silver.ucs.indiana.edu (Brian Wheeler)
Subject: Re: VBasic, copying files?
Message-ID: <Bx3F7C.Iy2@usenet.ucs.indiana.edu>
Sender: news@usenet.ucs.indiana.edu (USENET News System)
Nntp-Posting-Host: silver.ucs.indiana.edu
Organization: Indiana University
References: <jhbyne.720709286@unix1.tcd.ie>
Date: Mon, 2 Nov 1992 14:35:36 GMT
Lines: 57