Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Size Limit

Status
Not open for further replies.

Unscruffed

Programmer
Apr 2, 2002
102
AU
Is there any way around the 2gb file size limit using VB6?

Be good. If you can't, don't get caught!
 
You'd need to do I/O using API calls. If you hunt around you may find a Class for doing this so you don't have to reinvent the wheel.
 
Depending on what you want to do why not use the FileSystemObject?

Swi
 
Thanks guys. The 2 links provided heaps of info that I couldn't find before.

The reason I asked this question was that I needed to join a couple of DVD Vob files, so I could edit a clip that ran across the Vob boundary. VB clapped out when the output file reached 2GB with an "Invalid File Handle" error. I remembered coming across this once before and found a simple solution, but couldn't remember what it was. About half a slab of beer later, I remembered it was the good ol' faithful Copy command from DOS. In the end, I "Shelled" out a "Copy" command to "CMD.EXE" like this:

Shell "CMD /C COPY ""C\PATH TO FILES\FILE1.EXT"" /B ""C\PATH TO FILES\FILE2.EXT"" /B ""C\OUTPUT.EXT""", vbHide

The CMD /C switch tells CMD to exit on completion.
Long filenames are enclosed in quotes, and the /B switches indicate the source files are binary (use /A for Ascii files).

Overall progress can be monitored from VB by using a timer to check the size of the output file. I used FSO for this, as VB's FileLen function has the same limitations. A few easy calculations enables monitoring the progress of each source file as well. As mentioned in the above linked documents, use Currency variable types for this.

The beauty is that VB is not doing the work, so the app runs freely without any freezing, and there is no need to deal with API. A simple, but effective solution with no size limits.

Be good. If you can't, don't get caught!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top