| | |
Sumbit 2GB+ files to Windows Spooler
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2005
Posts: 2
Reputation:
Solved Threads: 0
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 -
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 -
•
•
Join Date: Jul 2005
Posts: 2
Reputation:
Solved Threads: 0
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
DH again
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.
![]() |
Similar Threads
- Use Backup to Restore Files and Folders on Your Computer in Windows XP (Windows tips 'n' tweaks)
- extract files when windows wont start (Windows NT / 2000 / XP)
- what 2 do 2 recover the files that have been replaced in windows xp (Troubleshooting Dead Machines)
- Can't access linux files from windows host using vmware (*nix Software)
- Installing bin/cue files Windows XP (Windows Software)
- Use Backup to Back Up Files and Folders on Your Computer in Windows XP (Windows tips 'n' tweaks)
- How to Rename Multiple Files with Windows Explorer (Windows tips 'n' tweaks)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: VB and Web Script
- Next Thread: errors in my file but not sure whats wrong file attatched
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






