Article View: borland.public.cppbuilder.nativeapi
Article #14404FileCreate function problem
From: Martin C
Date: Mon, 11 Aug 2003 23:25
Date: Mon, 11 Aug 2003 23:25
19 lines
1636 bytes
1636 bytes
I am trying to create a file on runtime and start using it, using the
following code..
if(!FileExists("c:\CProjects\test.txt"))
{
if(!FileCreate("c:\CProjects\test.txt"))
{
TStringList *Sample1 = new TStringList();
Sample1->LoadFromFile("c:\CProjects\test.txt"); // Error File
does not exist...!!!
}
}
please let me know what I am doing wrong here...and why the LoadFromFile
function fails although i am sure that the file is created...
P.S. it might look wierd why I am loading an empty file content in a
StringList, but I have my reasons for it...
thanks..
Technical Details
Message-ID:
<3f3989ee@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!priapus.visi.com!green.readfreenews.net!news.readfreenews.net!news-out.visi.com!petbe.visi.com!in.100proofnews.com!in.100proofnews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,5967b7894a1d3380,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-12 17:49:16 PST From: "Martin C" <martinc@aol.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: FileCreate function problem Date: Mon, 11 Aug 2003 15:25:21 -0800 Lines: 21 Organization: V Safe X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 62.135.7.221 Message-ID: <3f3989ee@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1060735470 62.135.7.221 (12 Aug 2003 17:44:30 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!priapus.visi.com!green.readfreenews.net!news.readfreenews.net!news-out.visi.com!petbe.visi.com!in.100proofnews.com!in.100proofnews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail