Subj : File access - BAJA
To   : Jim King
From : Amcleod
Date : Mon Apr 02 2001 12:34 pm

RE: File access - BAJA
BY: Jim King to ALL on Mon Apr 02 2001 06:12 pm

> Would someone be willing to write and explain a simple (short) program
> that reads from and writes to a file in Baja?
>
> Use as many of the file accessing routines found in Baja.
>
> From Baja Docs:
>
> FOPEN <int_var> <#>     <"str" or str_var>                      FILE_IO.INC
>  args: handle    access  path_and_filename
>
> FREAD <int_var> <any_var> [int_var or #]
>  args: handle    dest      length
>
> FCLOSE <int_var>
>   args: handle

Essentially you have it covered, except:  I'd recommend first a program that
opened the file, WROTE  some data and then closed it.  You decide what goes
into the file, what the format is, etc, etc, and you should have a pretty good
idea what to expect in that file when the program has executed.

THEN your SECOND program essentially does the opposite.  Open the same file,
read back the data and display it to confirm that you i) wrote it correctly;
ii) read it back as expected.

Do you understand the arguments to the commands listed above?  ("handle",
"access", etc)  Or do you need someone to run through them with you first?

---
� Synchronet � Vertrauen � Home of Synchronet � telnet://vert.synchro.net