Re: Writing data to an offset

new topic     » goto parent     » topic index » view thread      » older message » newer message

this worked.
Thank you!


----- Original Message -----=20
From: "Martin Stachon" <martin.stachon at worldonline.cz>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Writing data to an offset


>=20
> Andreas wrote:
> > How do  in a windows program you write a value (size of one byte) to
> > a specific offset i a binary file using euphoria? for an example i =
would
> > like to write the value 5D to offset 78C7F.
> > can someone give me a small example program? (all numbers are in =
hexadecimal).
>=20
> This should do it (not tested, as usual ;)
>=20
> ---------------------
> include file.e
> integer fn
>=20
> fn =3D open("myfile", "ub")
>=20
> if seek(fn, #78C7F) !=3D 0 then
>     puts(2, "Seek failed!\n")
>     abort(1)
> end if
> puts(fn, #5D)
> close(fn)
> ---------------------
>=20
>=20
> Regards,
>       Martin Stachon
>=20
> martin.stachon at tiscali.cz
> http://www.webpark.cz/stachon
>=20
> =
>=20
>=20
> =
>=20

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu