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?
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.