Re: [BULK] Re: batch file for dia execution under Windows



Lars,

On Fri, 2007-05-11 at 09:25 -0400, Clyde Roby wrote:
Steffen,

My DOS batch file, which runs in an MS Command Prompt window, contains
over 3000 lines; each line is of the following general format:

       dia -e output.png -t png input.dia

If I understand Lars correctly, try

dia -t png input1.dia input2.dia input3.dia

to create

input1.png
input2.png
input3.png

That should drastically reduce the dia startup overhead.

The above assumes that the created .png files are in the same
directory as the input .dia files.  If the input .dia files are in a
different directory that where I want to place the created .png files,
would the following still reduce the dia startup overhead?

dia -t png inputdir\input1.dia inputdir\input2.dia -e outputdir

or should the command line be:

dia -t png inputdir\input1.dia inputdir\input2.dia -e outputdir\input1.png outputdir\input2.png

Neither will give you the desired effect.  When -e is given, it is
exactly the name of the output *file*.  I suppose it would be a nice
touch if it used the directory if such was given, but it doesn't at
the moment.  You'll just have to move the files after conversion.

My program creates the several hundred .dia input files in the
inputdir directory.  It also creates a .bat file with commands
of the form:

        dia -t png in1.dia in2.dia ... inxxx.dia

where the length of these commands are no longer than 8000
characters (I think that the documented length of a command
line is 8192 characters).

There are enough of these commands created to handle the
conversion of the several hundred .dia input files.  I then
execute the move command to move all the .png files to their
final directory location.

After I got everything working the way I wanted it, I then
included the sequence of commands in its own .bat file so
that I only execute it.  This .bat file is effectively:

        cd graphInputCommands
        call executeDIA.bat
        del executeDIA.bat
        cd ..
        move graphInputCommands\*.png graphFiles

My program also generates several hundred HTML files which
reference the graphics files in the graphFiles directory.

Thank you all very much for the insight.  Execution of the
previous batch file (where every file was converted by its
own invocation of the dia program) was over 1.5 hours.
Execution of the new batch file (with lots and lots of files
converted by a single invocation of the dia program) is now
about 5 minutes.

As a wish-list item, it would be nice if the output directory
and the input directory could be a command line argument.
For the input directory, the input filenames could include it
as follows:

        dia -t png inpDir\in1.dia inpDir\in2.dia ...

For the output directory, the -e switch could check to see
that its argument is a directory and output all the converted
files to it.

Once again, thank you very much!

Clyde




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]