|
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int itHandle;
String stString = "HELLO\r\n";
itHandle = FileOpen("C:\\TEST.TXT", fmOpenReadWrite);
if(itHandle == -1) itHandle = FileCreate("C:\\TEST.TXT");
FileSeek(itHandle, 0, 2);
FileWrite(itHandle, stString.c_str(), stString.Length());
FileClose(itHandle);
}
//---------------------------------------------------------------------------
아마도, 빌더 전체 설치를 하시면 도움말을 보실 수 있을 같습니다.
그리고, 이 파일 여는 방식은, 바이너리 방식입니다. 아까 말씀 드린건 텍스트 방식이구요.
최수정 님이 쓰신 글 :
: 유영인.Chris 님이 쓰신 글 :
: :
: : int itHandle;
: : String stString;
: :
: :
: : itHandle = open("C:\\Test.TXT", O_WRONLY | O_TEXT | O_CREAT | O_APPEND);
: :
: : if(itHandle >= 0) {
: : stString = stString + "\n";
: : write(itHandle, stString.c_str(), strlen(stString.c_str()));
: : }
: :
: : close(itHandle);
:
:
: 혹시
: : itHandle = open("C:\\Test.TXT", O_WRONLY | O_TEXT | O_CREAT | O_APPEND);
: open함수 말구여..
:
: c++빌더 라이브러리 함수중에
: FileOpen함수로 하는거는 엄나여?
: FileOpen("C:\\TEST.TXT", 요기에// )
: 도움말로는 엄떤데여..
:
:
|