snowchyld
18th September 2002 11:09 UTC
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
brainsucker
18th September 2002 11:31 UTC
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...
snowchyld
18th September 2002 11:52 UTC
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 ?
kichik
18th September 2002 14:25 UTC
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.
snowchyld
18th September 2002 14:28 UTC
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 ;)