Archive: reading past EOF.. FileSeek ?


reading past EOF.. FileSeek ?
i currently am trying to read in past the EOF of the installer.. [file gets downloaded and 32 characters are tagged to the end of the installer]

FileOpen $R7 "$CMDLINE" "r"
FileSeek $R7 "-32" "END" $R6
FileRead $R6 $R8 32
FileClose $R7
MessageBox MB_OK "last 32 bytes == $R8"

what am i doing wrong o_O
all i want to do is read the last 32 bytes/chars tagged onto the end and for the life of me i'm not sure where i am going wrong
:weird:

thanks


Re: reading past EOF.. FileSeek ?

Originally posted by snowchyld
FileOpen $R7 "$CMDLINE" "r"
FileSeek $R7 "-32" "END" $R6
FileRead $R6 $R8 32
FileClose $R7
MessageBox MB_OK "last 32 bytes == $R8"
$R6 at FileSeek line is not necessary, it aquires the new position value and can be ommited. The error situated at FileRead line: the first variable have to be the file handle (like at all other commands), so $R7 according to your code. So:

FileSeek $R7 "-32" "END"
FileRead $R7 $R8 32

Just checked - that works fine...

hmm
if i am in the directory and run it [from command line] it works..
if i double click the icon it.. doesnt

o_O

FileOpen $R7 $CMDLINE "r"
FileSeek $R7 "-32" "END"
FileRead $R7 $R8 32
MessageBox MB_OK "32 bits == $R8"
FileClose $R7

any ideas ?


I told you it will happen :)
Make sure $CMDLINE is what you want it to be... Make sure it is not quoted, and make sure there are no command line parameters.


hehe

i know kchik ;)

thing is i need to read in the bytes from the file, and the only way that works at the moment is double clicking the icon, and stripping away the inverted commas..

*ponder*

im not expecting anyone to give command lines.. if they do ill just default the 32 bytes to something else ;)