in reply to Re^2: writing to a file via a named pipe
in thread writing to a file via a named pipe

If the pipe is a named pipe, you can just open it like any other file (except that seeking will not work, I guess).
  • Comment on Re^3: writing to a file via a named pipe

Replies are listed 'Best First'.
Re^4: writing to a file via a named pipe
by Anonymous Monk on Jan 29, 2009 at 15:54 UTC
    thanks guys, ill be testing this out tomorrow. i think it should work
Re^4: writing to a file via a named pipe
by Anonymous Monk on Jan 29, 2009 at 17:25 UTC
    basically what I want to do is open(PIPE, ">> xxx.fifo") or create a new pipe with the same name and write an error through it. any idea how I could accomplish that?
      Correction ... basically what I want to do is open(PIPE, ">> xxx.fifo") or in case the file is not openable for output, create a new pipe with the same name and write an error through it. any idea how I could accomplish that?
        my $pipe_qfn = 'xxx.fifo'; if (!-e $pipe_qfn) { system(mknod => $pipe_qfn, 'p') or die("Can't create pipe \"$pipe_qfn\": " .($?==-1 ? $! : "exit code $?")."\n"); } open(my $pipe_fh, '>>', $pipe_qfn) or die("Unable to open pipe \"$pipe_qfn\": $!\n"); print $pipe_fh $msg;