by Henning Thielemann <iakd0@[EMAIL PROTECTED]
>
Jan 19, 2004 at 12:33 PM
On Sat, 17 Jan 2004, Olaf Wagner wrote:
> Henning Thielemann <iakd0@[EMAIL PROTECTED]
> wrote:
>
> > Is there a module which allows for safe access to binary files, like
audio
> > or graphic files? I think it should sup****t such routines like
>
> > PutInt (wr: File.T; val: INTEGER; byteOrder: Endian; size: CARDINAL;
);
> > PutReal (wr: File.T; real: REAL; byteOrder: Endian; );
> > PutChar (wr: File.T; char: CHAR; );
>
> > and so on.
>
> What exactly do you mean by `safe'?
Using libm3/src/os/Common/File.i3 you need LOOPHOLE to convert several
datatypes into an ARRAY OF Byte, which is an unsafe operation. When using
LOOPHOLE to convert an INTEGER into an ARRAY OF Byte the programs become
machine dependent because of the byte order. Alternatively one could
convert numbers and texts into ARRAYs OF Byte manually which is
***bersome.
I just like to demonstrate students how to create binary files like audio
streams with Modula 3.