Re: Thanks so much!


2005-05-12 04:27:01 AM
kylix0
theo < XXXX@XXXXX.COM >wrote:
Quote

>
>Help ->C Runtime Library Reference ->Input/output Routines ->open ->
>Example

This does the job for me:


#include "string.h"
#include "stdio.h"
#include "fcntl.h"
#include "io.h"

.....

void __fastcall TForm1::Button1Click(TObject *Sender)
{
int handle;
String msg = String(Edit1->Text);

if ((handle = open("/home/theo/cppwtest.txt", O_RDWR | O_CREAT |
O_TEXT | O_TRUNC)) == -1) {
perror("Error");
}

write(handle, msg.c_str(), msg.Length());
close(handle);
}


But I'm sure there are other/better ways, because I don't know much about C.
Thanks so much!....i managed to do to wot i wanted!
Thx a lot again!