[fpc-pascal] Resources or alike

bobmartin at ntlworld.com bobmartin at ntlworld.com
Sun Mar 20 12:28:36 CET 2005


How did you define ExeFile ?


Micha? Wo?niak <mikiwoz at yahoo.co.uk> wrote the following on 20/03/05 11:37:32:
> 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  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal





More information about the fpc-pascal mailing list