🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Read Directory - File

#6320
From: Liz Albin
Date: Wed, 25 May 2005 17:56
24 lines
1675 bytes
On 25 May 2005 10:38:27 -0700, Pieter wrote:

> Hello, 
> 
> Please, I have two questions which I like to ask here: 
> 
> 1) I want to read all the files contained in a given directory. Which
> API should I use? Also if I want to read only the files with a certain
> extension.

Assuming you want windows API functions, check the Window's Developer's
References for  FindFirstFileEx and FindNextFile

> 2) In a file there are multiple lines. I want to read a line in that
> file, do something with it and move to the next one till the end of the
> file. What is the best way to do that and I will apreciate it if you can
> provide me with code example. 

Check std::getline()

-- 
Good luck,

liz
Technical Details
Message-ID: <1m36hxsbw6smr.tbx1noy82qxr$.dlg@40tude.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!proxad.net!feeder1.cambrium.nl!feed.tweaknews.nl!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4294b813$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,57ff8ac7d09a7b63
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Liz Albin <lizalbin@yahooNotThis.com>
Subject: Re: Read Directory - File
Newsgroups: borland.public.cppbuilder.nativeapi
User-Agent: 40tude_Dialog/2.0.15.1 (589c08b9.222.304)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
References: <4294b813$1@newsgroups.borland.com>
Date: Wed, 25 May 2005 10:56:49 -0700
Message-ID: <1m36hxsbw6smr.tbx1noy82qxr$.dlg@40tude.net>
X-Realname: Liz Albin
NNTP-Posting-Host: 69.229.5.205
X-Trace: newsgroups.borland.com 1117043949 69.229.5.205 (25 May 2005 10:59:09 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!proxad.net!feeder1.cambrium.nl!feed.tweaknews.nl!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail