ID:145209
 
Code:
mob/verb/Check(F as file)
F = file2text(F) // I'm not going to show my code since it was rather hard making, so I'll just show the incomplete file opening stuff.
src << F


Problem description:

Well, I'm making a file compressor, but I can't seem to open the whole file up with file2text(). All I get is the beginning part of the file. The thing is, even though I get to compress part of the file, the user won't be able to save it, since the file doesn't have everything needed in it. How could I get file2text() to work?
file2text() fails on certain characters. On text files, this isn't a problem, but on binary files, like graphics, etc, it can run into characters that make it think it's found the end of the file, and then stops.

If you want to save stuff as a .zip file though, you could use Dantom's zipfile library for that. Documentation is kind of non-existant, but it shouldn't be too hard to figure out, and I think there's already been a couple of questions answered about it on the forums.
In response to Jon88
Yeah, I did a forum search before posting, but I didn't actually find anything that helped. What I'm trying to do is zip files in my own way, but I can't do it without being able to get into the whole file. Is there a way I can get file2text() to work with the whole file or use something else?
In response to LXShadow
LXShadow wrote:
Is there a way I can get file2text() to work with the whole file or use something else?

Nope, sorry. :(
In response to Jon88
Ah well. Thanks anyway, maybe I could make one of these compressors in a different programming language.