Files in Folder

B

BB

Hi,
How do you retrieve the names of all files in a folder.
I am trying to execute a piece of code on all files in a folder supplied to
the program in the argument list.
What are the c++ commands for folder and file manipulations
Thanks
 
R

Rolf Magnus

BB said:
Hi,
How do you retrieve the names of all files in a folder.
I am trying to execute a piece of code on all files in a folder
supplied to the program in the argument list.
What are the c++ commands for folder and file manipulations

Files can be manipulated through ifstream, ofstream and fstream, but C++
does not have a concept of "folder" or anything similar. So you can't
do what you want with the standard library. You need to use system
specific extensions.
 
C

Christoph Rabel

BB said:
How do you retrieve the names of all files in a folder.
I am trying to execute a piece of code on all files in a folder supplied to
the program in the argument list.
What are the c++ commands for folder and file manipulations

There are no C++ commands for folders. But you could check:

http://boost.org/libs/filesystem/doc/index.htm

It is a filesystem library that works for POSIX and Windows
operating systems.

hth,

Christoph
 
N

Nirmalya Ghosh Chowdhury

Although there is no C++ command, but I think we can use system calls
like readdir, opendir - which are also of Posix Standard.
Gurus, correct me if I am wrong.

NGC
 
O

osmium

Nirmalya Ghosh Chowdhury writes:

[rearranged]
Although there is no C++ command, but I think we can use system calls
like readdir, opendir - which are also of Posix Standard.
Gurus, correct me if I am wrong.

NGC

I am not a guru, just a humble supplicant.

But do you really think that someone who won't allow a simple word
substitution is going to allow the introduction of a non-standard standard
into God's Chosen Standard? Hmmm?
 
R

Rolf Magnus

osmium said:
Nirmalya Ghosh Chowdhury writes:

[rearranged]
Although there is no C++ command, but I think we can use system calls
like readdir, opendir - which are also of Posix Standard.
Gurus, correct me if I am wrong.

NGC

I am not a guru, just a humble supplicant.

But do you really think that someone who won't allow a simple word
substitution

It's good to tell people if they use wrong terminology. How else would
they learn to use the right one?
is going to allow the introduction of a non-standard standard

What is a "non-standard standard"?
into God's Chosen Standard? Hmmm?

What?
 
O

osmium

Rolf said:
osmium said:
Nirmalya Ghosh Chowdhury writes:

[rearranged]
Jack Klein wrote:
On Thu, 18 Dec 2003 22:30:34 +0100, Christoph Rabel


BB wrote:

How do you retrieve the names of all files in a folder.
I am trying to execute a piece of code on all files in a folder supplied to
the program in the argument list.
What are the c++ commands for folder and file manipulations

There are no C++ commands for folders.


There are no C++ "commands" at all.
Although there is no C++ command, but I think we can use system calls
like readdir, opendir - which are also of Posix Standard.
Gurus, correct me if I am wrong.

NGC

I am not a guru, just a humble supplicant.

But do you really think that someone who won't allow a simple word
substitution

It's good to tell people if they use wrong terminology. How else would
they learn to use the right one?

I have no objection to a correction, if it is meant to be informative. The
above is phrased in too subtle a manner for a beginner to understand; it is
preaching to the choir. A statement of the form:

C does not have "commands". What you
probably mean is "function call"

would be an understandable correction. To simply say "C doesn't have
commands" is simply snide. A person who doesn't already know the answer is
simply left with a "What is this all about?" feeling.
What is a "non-standard standard"?


What?

A standard that has not been approved by ISO/ECMA/ANSI/whatever. It's the
difference between de facto and de jure.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,408
Latest member
AlenaRay88

Latest Threads

Top