|
-
Jun 8th, 2005, 06:49 PM
#1
Thread Starter
Hyperactive Member
VB6 - Fastest method of IO with files Open or FSO
Which code would be more efficient to use, especially going over a network connection (if that makes a difference). If the file is say 100 bytes to 1kB in size?
VB Code:
Open App.Path & "\test.txt" For Output As #1
Print #1, "insert string here"
Close #1
or
VB Code:
Dim txtFile As TextStream
Set txtFile = fs.OpenTextFile(App.Path & "\test.txt", ForWriting)
txtFile.Write "insert string here"
txtFile.Close
Also, in this particular app, one copy of the file is saved locally, while the other is saved on a network share. Would copying the file using FSO be quicker or more efficient than opening the file and printing to it?
VB.NET 2005 Express with .Net 2.0
C# 2010 .Net 4.0
-
Jun 13th, 2005, 10:39 AM
#2
Re: VB6 - Fastest method of IO with files Open or FSO
For a small file, the first method will be faster. I haven't tested it on a network share yet. I am considering the file is placed locally.
Will test in the office and let you know about network shares.
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|