Dealing with multiple inputfiles at runtime?

N

none

Maybe this is not directly a C++ question but since my app is written in C++ I will get it a try.

I have an application that reads jobs from a job container and process each job until the container
is empty. Each job has a unique id.

Now when a job is being processed one or more files needs to be read. Each file basically just
contains a list of floats (and the filename is prefixed with the jobId).

My current approach is to make one file for all the jobs where I write the path to the directory
containing the input files. This looks likes this:

coeff_dir = /home/bob/input/

When the application is run the current jobId is used to lookup the right file in the folder.


Are there any better way (maybe using xml) to do this kind of file input based application?
 
A

Alf P. Steinbach

Maybe this is not directly a C++ question but since my app is written in
C++ I will get it a try.

I have an application that reads jobs from a job container and process
each job until the container is empty. Each job has a unique id.

Now when a job is being processed one or more files needs to be read.
Each file basically just contains a list of floats (and the filename is
prefixed with the jobId).

My current approach is to make one file for all the jobs where I write
the path to the directory containing the input files. This looks likes
this:

coeff_dir = /home/bob/input/

When the application is run the current jobId is used to lookup the
right file in the folder.


Are there any better way (maybe using xml) to do this kind of file input
based application?

KISS -- Keep It Simple, Stupid. ;-)

I.e. current approach good.

XML needless complication + inefficiency.


Cheers & hth.,

- Alf
 
Ö

Öö Tiib

Maybe this is not directly a C++ question but since my app is written in C++ I will get it a try.

I have an application that reads jobs from a job container and process each job until the container
is empty. Each job has a unique id.

Now when a job is being processed one or more files needs to be read. Each file basically just
contains a list of floats (and the filename is prefixed with the jobId).

My current approach is to make one file for all the jobs where I write the path to the directory
containing the input files. This looks likes this:

coeff_dir = /home/bob/input/

When the application is run the current jobId is used to lookup the right file in the folder.

Are there any better way (maybe using xml) to do this kind of file input based application?

Best way is to keep simple application settings ints and strings in
ini file. Ini file has easy to read and to understand. It is simpler
to manually edit than xml. There is portable ini file parsers/writers
code lying all over everywhere. Also your own "file for all the jobs"
looks exactly like a line from ini file.
 

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,146
Messages
2,570,832
Members
47,374
Latest member
EmeliaBryc

Latest Threads

Top