Dealing with multiple inputfiles at runtime?

Discussion in 'C++' started by none, May 4, 2010.

  1. none

    none Guest

    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?
     
    none, May 4, 2010
    #1
    1. Advertising

  2. On 04.05.2010 21:48, * 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?


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

    I.e. current approach good.

    XML needless complication + inefficiency.


    Cheers & hth.,

    - Alf
     
    Alf P. Steinbach, May 4, 2010
    #2
    1. Advertising

  3. none

    Öö Tiib Guest

    On 4 mai, 22:48, none <""mort\"@(none)"> wrote:
    > 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.
     
    Öö Tiib, May 4, 2010
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Barker
    Replies:
    3
    Views:
    304
    Graham Dumpleton
    Apr 22, 2004
  2. John Henry

    Dealing with multiple sets

    John Henry, Oct 26, 2006, in forum: Python
    Replies:
    6
    Views:
    266
    John Henry
    Oct 26, 2006
  3. Aaron W. LaFramboise
    Replies:
    4
    Views:
    349
  4. Rohan
    Replies:
    2
    Views:
    323
    Neil Cerutti
    Aug 7, 2007
  5. Isak
    Replies:
    2
    Views:
    81
Loading...

Share This Page