Board index » cppbuilder » help -plz....--file code....(a simple one)
DILIP K
![]() CBuilder Developer |
help -plz....--file code....(a simple one)2005-11-02 02:12:40 AM cppbuilder0 // end_of_file is bool void __fastcall TForm1::Button1Click(TObject *Sender) { OpenDialog1->Execute(); Edit1->Text=OpenDialog1->FileName; TFileStream *t1=new TFileStream(Edit1->Text,fmOpenRead); if(FileCreate("d:\\trial.cpy")==-1) Button2->Click(); TFileStream *t2=new TFileStream(s,fmOpenWrite|fmShareDenyNone); t1->Seek(0,0); t2->Seek(0,0); while(end_of_file==false) { if(t1->Read((char *)&c,1)==1) t2->Write((char *)&c,1); else end_of_file=true; } t1->Free(); t2->Free(); t1->~TFileStream(); t2->~TFileStream(); } here's the simple code...if u have a nice code plz send it here |