サブプロセスを起動するアプリケーションがあります。サブプロセスは、操作するファイルをstdinから読み取ります。一部の操作では、操作するファイルをどう処理するかに関する情報を含む入力ファイルが必要です。これを「制御ファイル」と呼びましょう。制御ファイルの名前もstdinから読み取られます。親アプリケーションは一時ファイルを制御ファイルとして使用できますが、実際のディスクバックアップファイルは避けたいと思います。
On Linux, this is simple: I can create a Unix pipe, fork, close the respective ends of the pipe before starting the subprocess, and use /dev/fd/3
(or whatever the file descriptor is) as control file name, and then write the control data to the pipe in the parent application. Alternatively, I could use a named pipe in /tmp
(or whatever).
How could I achieve a similar thing on Windows? Could the strange "named pipes" Windows offers be used for this, that is, can they be read from by the usual C library fread()
function? If yes, what file name do I use to access them? Or is there a better way than using named pipes?
(The subprocess is the exiftool
command-line utility run in batch mode, so I don't have control over it. The parent application is written in Python.)