Sumbit 2GB+ files to Windows Spooler

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2005
Posts: 2
Reputation: David Hunt is an unknown quantity at this point 
Solved Threads: 0
David Hunt David Hunt is offline Offline
Newbie Poster

Sumbit 2GB+ files to Windows Spooler

 
0
  #1
Jul 8th, 2005
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 -
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 2
Reputation: David Hunt is an unknown quantity at this point 
Solved Threads: 0
David Hunt David Hunt is offline Offline
Newbie Poster

Re: Sumbit 2GB+ files to Windows Spooler

 
0
  #2
Jul 8th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Sumbit 2GB+ files to Windows Spooler

 
0
  #3
Jul 8th, 2005
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC