🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7716

Re: File I/O

#7716
From: Remy Lebeau (TeamB)
Date: Tue, 11 Jan 2005 18:58
37 lines
2519 bytes
"Patrick Wong" <patrickwong@computer.org> wrote in message
news:41e3ab0a@newsgroups.borland.com...

> My perception is that VCL are something present on the IDE componet
> palette, which can be drag-n-drop on a form and provide P(roperties)
> M(ethods)E(vents) interface for users.

Your perseption of the VCL is very limited.  The VCL is a lot more then just
the components you see on the palette.  It is an entire framework of its
own.  The components are just a piece of a much larger library.

> And they are OO to begin with, that is, the user has to instantiate an
> object to work with them.

There are many units in the VCL that don't have objects at all.  SysUtils,
for example, is mainly just standalone utility functions.  Same with Math.

> BCB(Delphi) File I/O do not have object to operate.

It does if you use TFileStream ;-)

> To ask more specifically, FileOpen() can open an existing file with
> desired access mode.  However, when one has to open a *NEW*
> file, the FileCreate() does not have such access mode to select.

Correct.

> Do I have to create it by FileCreate(), then FileClose(), and then
> FileOpen() again to allow the file to work in the desired fashion?

Yes.  Otherwise, don't use the VCL file I/O functions to begin with.  Use
the Win32 API directly, specifically CreateFile() (which both FileOpen() and
FileCreate() use internally).


Gambit
Technical Details
Message-ID: <41e42185$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed.bit.nl!newsfeed.bit.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41e33da8$1@newsgroups.borland.com> <41e3561e$3@newsgroups.borland.com> <41e3ab0a@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,991cc71bafbd3990
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <41e33da8$1@newsgroups.borland.com> <41e3561e$3@newsgroups.borland.com> <41e3ab0a@newsgroups.borland.com>
Subject: Re: File I/O
Date: Tue, 11 Jan 2005 10:58:58 -0800
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <41e42185$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1105469829 68.69.17.41 (11 Jan 2005 10:57:09 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed.bit.nl!newsfeed.bit.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail