Page 1 of 1

Eof() In Word documents

Posted: Sat Jun 19, 2004 11:01 pm
by Killswitch
Does Eof() work properly with word documents? I was playig about with the commands a few minutes ago, and my code works perfectly with a .txt document but with a word document it just keeps on going!

i.e: It had one line in it 'jimmy' and was printing thousands of blank lines to the console, so much so that it crashed the program.

I haven't posted the code as I don't think its relevent.

Posted: Sat Jun 19, 2004 11:08 pm
by freak
The function works properly with all types of files.

A word document does contain lots of binary data. It is no plain text format.
(for example, save an empty word page to disk, you get a 19kb file. There is
obviously no text in it, but lots of other data.)

Of course, if you just try to read that as text and print it to the console,
you get lots of empty lines.

Timo

Posted: Sun Jun 20, 2004 12:38 am
by PolyVector
I've heard the format also stores info about the origin of the file...(to track down baddies and such)... Apparently they've caught many a hacker this way :twisted:

Posted: Sun Jun 20, 2004 10:30 am
by Killswitch
Thank you for that extremly relevent comment, :?: :?: 8O
I suppose I could just rename the word document to a .txt document, then I could work it out that way.

Posted: Sun Jun 20, 2004 10:36 am
by Dare2
Killswitch wrote:Thank you for that extremly relevent comment, :?: :?: 8O
I suppose I could just rename the word document to a .txt document, then I could work it out that way.
Not sure that would work (if you were being serious - and if you are using readstring) because, as Freak pointed out, a word document does not only contain text.

Also, maybe relax a little. :P