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

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?
  • Comment on Re^4: writing to a file via a named pipe

Replies are listed 'Best First'.
Re^5: writing to a file via a named pipe
by Anonymous Monk on Jan 29, 2009 at 17:30 UTC
    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;