Large 2GB+ file stream
BlitzMax Forums/BlitzMax Programming/Large 2GB+ file stream
| ||
This is my first attempt at creating a file stream that exceeds the current 32bit limit. I haven't tested it much, it does however work writing to a file past the 32bit barrier. You should use the PosEx, SizeEx, and SeekEx to handle the larger 64bit positions and size. It's Win32 only. |
| ||
Couldnt you also use file mapping for this? I use file mapping to manipulate large database files, which is, afaik, what it's intended to be used for [in addition to shared memory]. |
| ||
Actually this is just meant to be an alternative file stream that can read and write files larger than 2GB which the standard module doesn't support. |
| ||
Oh I propably behaved a little ignorant, sry, I realy like this solution! It was just a thought, that immidiately came to my mind when I saw your solution. |
| ||
fraggin heck that would be one hell of a level to have a file thats 2Gb :s |
| ||
What can I say, I like my whole world defined to the last blade of grass ;) |
| ||
I've encountered a problem with this 2gb limit... A couple of questions: How do I do this in linux? How do i do file mapping? |
| ||
How do I do this in linux? Use Wine ? :-) |
| ||
Ah thanks Brucey, but i'm looking for another approach :) |
| ||
Ah! Well, there is a module called BaH.SStream, which could do with some proper testing. It's basically a port of BRL.Stream with large file support. Type names have an extra "S". So, TSStream instead of TStream. And of course, most things return Long instead of Int. It's in SVN. |
| ||
thanks |
| ||
I get this: Compile error: Duplicate identifier 'WriteStream' in modules 'brl.stream' and 'bah.sstream' I tried to comment out "import brl.stream", but to no luck So i edited sstream.bmx, just changing some of the function names, and then rebuilt the module. Then building my program gave me this error: /home/BlitzMax/mod/bah.mod/sstream.mod/sstream.release.linux.x86.a(glue.c.release.linux.x86.o): In function `ftell64_': glue.c:(.text+0x4b): undefined reference to `ftell64' So i replaced line 33 of glue.c with: *pos = ftello64(stream); And now it works in linux :) ps. and it's really fast too :) |