Dnia sobota, 19 marca 2005 23:31, Nico AragÃn napisaÅ:
> IIRC, you don't even need resources:
>
> copy /b program.exe + file.dat combined.exe
>
> Then you can open combined.exe from itself, seek to (filelength -
> sizeofdatafile -1) and use blockread.
Uhmm... I get a Runtime error 026 everytime I try to open the executable for
reading from within itself. Here's the code:
try
writeln('Assigning file "' + ParamStr(0) + '".');
Assign(ExeFile, ParamStr(0));
writeln('Reseting...');
Reset(ExeFile); // <- ERROR HERE
writeln('Seeking...');
Seek(ExeFile,FileSize(ExeFile)-14);
except
on E:Exception do
begin
writeln('Exception: ' + E.Message);
halt;
end;
end;
Am I missing something?
TIA
Mike
_______________________________________________
fpc-pascal maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal