Advertisement

No way to allocate memory in VB?

Started by November 18, 2000 01:39 PM
10 comments, last by vbisme 24 years, 2 months ago
The array method works fine, thanks. I was making an interface to pack many files into on file. The reason I want to read it into memory is because I wanted to extract information for it and manipulate it in C/C++ later.
GACK! NO! UGLY!

DON'T use FileSystem objects unless you're a: massochistic or b: a complete nut...

there's also a FileCopy statement that works almost exactly like the COPY command in DOS. Just "FileCopy("C:\Source","C:\Destination")"... much simpler than trying to deal with filesys objs...
There is no FileMove command (to my knowledge), but you can write one as so:
    Sub FileMove(ByVal Source As String, ByVal Dest As String)    FileCopy Source, Dest    Kill SourceEnd Sub    

...naturally, that's pretty much how windows does it anyway when you move between drives... For same-drive moves, I think it actually modifies the FAT to change where the system thinks the file is, rather than moving the actual data. Try moving a very large directory to somewhere else on the same drive and see if it doesn't take a lot less time than it "should".

Of course, if you're concatenating files, you want to use the array-buffer method...



Apologies to Machaira, but I can't stand those evil filesystem objects... especially when there is a much easier alternative.
(Now if I can only get my PC to stop forgetting my username and settings... grr)

--Tr][aD--

Edited by - TrIaD on November 25, 2000 3:21:51 PM
--Tr][aD--

This topic is closed to new replies.

Advertisement