Hi David,

I'm using the Gx from VB and can confirm that the same thing happens there.
You can get the desired behaviour as follows:

  if (iFileExist_SYS("data.bin"))
       {
         hBF = Create_BF(hBf , BF_READWRITE_OLD);
         _Seek_BF(hBf , 0, BF_SEEK_EOF);
       }
  else
     hBf = Create_BF("data.bin",BF_READWRITE_NEW);

ie open the file in OLD mode, seek to the end of the file and then append
your data. (Sorry if the C syntax is not quite right, but I'm translating
from VB).

Best regards
John Paine

----- Original Message -----
From: "David Triggs" <[EMAIL PROTECTED]>
To: "GXNET" <[EMAIL PROTECTED]>
Sent: Tuesday, August 15, 2000 5:01 PM
Subject: [gxnet]: Appending to Binary Files


> Hi List,
>
> Has anyone been able to access a binary file for appending.? I am trying
> to use the following code to access a binary file
>    if (iFileExist_SYS("data.bin"))
>       {
>     hBf = Create_BF("data.bin",BF_READWRITE_APP);
>       }
>    else
>   hBf = Create_BF("data.bin",BF_READWRITE_NEW);
>
> If the file exists, anything I send to the file should be appended to
> the end of the file. However, after I reported the byte number to the
> screen I found that each variable I try to write to the file uses the
> same byte number. The data is made up of 3, 4 byte reals (GS_FLOAT), so
> it not a complex sequence. No matter how many times I run this GX the
> size of the file is always 12 bytes.
>
> There are no examples in the current GXC's of BF_READWRITE_APP being
> used. Does anyone have any ideas.
>
> Thanks very much
>
>
> David
>
> --
> ************************************************************
>       *
>     *   *         David Triggs
>                   Fugro Airborne Surveys
>      *            65 Brockway Rd
>                   Floreat W.A. 6014
>
>                   [EMAIL PROTECTED]
>
> ***********************************************************
>
>
> _______________________________________________________
> More mailing list info http://www.geosoft.com/support/listserv/index.html
> List Archive http://www.mail-archive.com/[email protected]

_______________________________________________________
More mailing list info http://www.geosoft.com/support/listserv/index.html
List Archive http://www.mail-archive.com/[email protected]

Reply via email to