0

I have previously asked a question, which is somewhat related to the present one, however, Please help a bit more.

As I understand it, from this link, I should be able to use redirect.stdin to a named pipe, then use a putc or binary write command to the pipe, and write unformatted data to it.

Nonetheless, I would love, that on the other end, a parallely running fortran process reads form one pipe, to which my D code writes in, and writes to another, from which i can read off, while in the D code.

Now problem is I don't find much information about named pipes in Fortran.

Before I use a C interface, to Fortran, is there any way to read pipes and write on a separate parallel pipe from Fortran?

EDIT: thanks for the hints, I sorted it.

Community
  • 1
  • 1
Sean
  • 789
  • 6
  • 26
  • 3
    This question appears to be off-topic because Stack Overflow is not a free custom code development resource. Please review the help files regarding good questions. – Tom Zych Jul 09 '14 at 22:16
  • 1
    You can make D application create named pipe for you, and you just open it as a normal file in Fortran... C example: http://stackoverflow.com/questions/2784500/how-to-send-a-simple-string-between-two-programs-using-pipes . – DejanLekic Jul 10 '14 at 13:06

1 Answers1

1

I don't know much about Fortran but if you use the pipe redirection on the D side, the Fortran side just needs to use regular input read and output write functions, just like printing text to the screen, and it will be received on the D side.

Adam D. Ruppe
  • 25,382
  • 4
  • 41
  • 60