Getting the file name

C

cjw

I have a c++ program,it takes a BMP file and do some operations on the
file. What I want to know is how to get the file name automatically
and run the program in batch mode as I have to run this for large No
of files.

Please help.
 
C

Case

cjw said:
I have a c++ program,it takes a BMP file and do some operations on the
file. What I want to know is how to get the file name automatically
and run the program in batch mode as I have to run this for large No
of files.

This NG deals with C not with C++. I think you could best use the
commandtool/shell scripting features of the operating system your're
using. It's not that difficult to get a list of filenames and a loop
which run your program for each name in this list. Good luck.

Case
 
I

Irrwahn Grausewitz

I have a c++ program,it takes a BMP file and do some operations on the
file. What I want to know is how to get the file name automatically
and run the program in batch mode as I have to run this for large No
of files.

Please help.

And your C question was?

Regards
 
D

Darrell Grainger

I have a c++ program,it takes a BMP file and do some operations on the
file. What I want to know is how to get the file name automatically
and run the program in batch mode as I have to run this for large No
of files.

Questions regarding the C++ programming language should be directed to
comp.lang.c++ and not comp.lang.c. Regardless, the answer for this is
pretty much the same.

You can get input from the command line arguments using argv or you can
get input from stdin. If you can code the program so it works with either
method, most operating systems will have a way of making this batch mode.
How you do that depends on the operating system and would be outside the
scope of comp.lang.c (or comp.lang.c++).

So, write a program that will get the filename from stdin or one that will
get the names from the command line. The command line method might have a
limit. If you have a huge number of filename you might want to go with
stdin. If you are having problems with this program ask for help in
comp.lang.c++. Once you get it working manually, find a newsgroup that
deals with your operating system and ask how you can process many files
with this program.
 

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

No members online now.

Forum statistics

Threads
474,142
Messages
2,570,820
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top