Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Example of editing the SESMON output file with C

If you want to read the records using C (fread), you receive the records without the fourbyte long record length field. In this case, you have to reduce all distances by four.

.
.
char        buf_in[32768];           /* Buffer for reading          */
                                     /* ( 32768 (corresponding to   */
                                     /* STD,16) is taken as the     */
                                     /* buffer size so that the     */
                                     /* buffer size does not have   */
                                     /* to be changed if the length */
                                     /* of a record increases )     */
int         nread;                   /* Number of characters read   */
FILE       *dz;                      /* File pointer                */
.
.
/* Open file */
dz = fopen("link=sesmon","rb,type=record");
while ( !feof(dz) && !ferror(dz) )
{
   /* Read a record */
   nread = fread( (void *)buf_in, 1, sizeof(buf_in), dz);
   if ( nread > 0 )
   {
       /* Edit a record that has been read */
       .
       .
   }
}
if ( ferror(dz) )
{
   /* Output error message */
   .
   .
}
fclose(dz);
.
.