Article View: borland.public.cppbuilder.nativeapi
Article #14406Re: FileCreate function problem
From: Norm Jaffe
Date: Wed, 13 Aug 2003 00:58
Date: Wed, 13 Aug 2003 00:58
28 lines
1945 bytes
1945 bytes
Is this the exact code that you are using? If so, you'll need to "double-up"
each of the backslashes,
as "c:\\CProjects\\test.txt".
Norm Jaffe
"Martin C" <martinc@aol.com> wrote in message
news:3f3989ee@newsgroups.borland.com...
> 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:
<3f398d1f$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f3989ee@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,5967b7894a1d3380 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-12 18:16:48 PST From: "Norm Jaffe" <mail@aurelsystems.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f3989ee@newsgroups.borland.com> Subject: Re: FileCreate function problem Date: Tue, 12 Aug 2003 17:58:22 -0700 Lines: 30 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: 209.121.14.114 Message-ID: <3f398d1f$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1060736287 209.121.14.114 (12 Aug 2003 17:58:07 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail