944,051 Members | Top Members by Rank

Ad:
Jul 8th, 2005
0

Sumbit 2GB+ files to Windows Spooler

Expand Post »
I get very large binary print files that need to be sent directly to the Windows spooler. If the file is less than 2GB, I get LOF (or FileLen) and divide that by a defined buffer size. A segment of the input file is read into the buffer and then a function is called to write the buffer to winspool.drv.

This works just fine until the input file exceeds 2GB - at that point, since both LOF and FileLen return LONG values, I can't get the filesize and don't know how many times to read into the buffer.

I guess the question is 'How do I get the filesize of a +2GB file?

Thanks -
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
David Hunt is offline Offline
2 posts
since Jul 2005
Jul 8th, 2005
0

Re: Sumbit 2GB+ files to Windows Spooler

The problem is worse than I thought . . . I use the fso model to get the size of the file then calculate the number of buffer read/write processes using a Get and Put sequence to insert the file into the Windows spooler. Trouble is that Get and Put us 'seek' as the middle argument as a marker of the next byte to read, and it is also a LONG value . . . ugh! Any suggestions?

DH again
Reputation Points: 10
Solved Threads: 0
Newbie Poster
David Hunt is offline Offline
2 posts
since Jul 2005
Jul 8th, 2005
0

Re: Sumbit 2GB+ files to Windows Spooler

sure, you can get the filesize, through unconventional means, OR you can get the file size in long value, and check if it's larger than 2GB, (just check the long value size), if it IS bigger than 2GB's, then generate 2 temp files, with 1/2 of the file in each (or more, if it's bigger than 4 gigs, or whatever). Then, in order of the temp files, read each one the standard way, and use the function on those. It seems like a bigger pain than is needed, but I'm sure it would work. I suppose another option, would be to read the file byte by byte, an d concantenate a variable, while keeping another variable to keep track of the size.... but that also seems like a bit of a pain.... let me know what you come up with.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: VB and Web Script
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: errors in my file but not sure whats wrong file attatched





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC