in reply to Re: Replace filename with pipe in program argument?
in thread Replace filename with pipe in program argument?

Thanks :)

This kind of works:

my @args=();
@args=("$pipeline/EXE/searchXY", "-5", "UEB2K005I", "locate", "234", "156", "4", "Print"); system(@args);

where earlier system "/usr/bin/mkfifo $pipeline/OUT/locate";

this sends it to the right place, but it gets the stuck at the process. Namely, the pipe is open for writing, and waits to be read, the C program gets paused until something reads the pipe... no problem so far :) This is as it should be from what I managed to understand about named pipes.

One more minor problem is that my whole script gets stuck at the point of when the pipe is open, waiting to be read... as the reading part is after the pipe open (the call to the C program opens it).

I suspect I need to start off the C program as some independent process, NOT use system(). I'll post the solutions when I fully work it out. The KEY here were named pipes :)

THANKS ALL :) The suggestions were RIGHT what I needed.

  • Comment on Re^2: Replace filename with pipe in program argument?

Replies are listed 'Best First'.
Re^3: Replace filename with pipe in program argument?
by Roy Johnson (Monsignor) on Mar 22, 2005 at 02:51 UTC
    You just need to fork before you call system, so that your system is running in its own process.

    Caution: Contents may have been coded under pressure.