I'm going to be passed a dos based command to my vb6 program. I would like to take the multiline output of that command and create a command line command for each line it generates. The only way I know to do this at the moment is to pipe it to a text file and then read that file in a line at a time creating the command and issuing it or creating a batch file and executing it. Either way, the extra I/O will probably cause overhead I don't want. Any ideas?

Recommended Answers

All 3 Replies

I'm going to be passed a dos based command to my vb6 program. I would like to take the multiline output of that command and create a command line command for each line it generates. The only way I know to do this at the moment is to pipe it to a text file and then read that file in a line at a time creating the command and issuing it or creating a batch file and executing it. Either way, the extra I/O will probably cause overhead I don't want. Any ideas?

Why to create a text file? Your pipe itself saves this purpose. FIFO.

Why to create a text file? Your pipe itself saves this purpose. FIFO.

I need to alter the output so that it becomes the executable I need. Can I pipe to an array?

I need to alter the output so that it becomes the executable I need. Can I pipe to an array?

That depends upon the size of your output. If it is samll you can size and resize an array. But if it is too large your program address space will demand more memory which may cause other programs not to co-exist.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.