| author | blanchet | 
| Mon, 30 Aug 2010 18:07:29 +0200 | |
| changeset 38906 | f76ac80e9bcd | 
| parent 38253 | 3d4e521014f7 | 
| child 39520 | bad14b7d0520 | 
| permissions | -rwxr-xr-x | 
| 28047 | 1 | #!/usr/bin/env bash | 
| 2 | # | |
| 3 | # Author: Makarius | |
| 4 | # | |
| 5 | # DESCRIPTION: create named pipe | |
| 6 | ||
| 7 | ||
| 8 | PRG="$(basename "$0")" | |
| 9 | ||
| 10 | function usage() | |
| 11 | {
 | |
| 12 | echo | |
| 28650 | 13 | echo "Usage: isabelle $PRG" | 
| 28047 | 14 | echo | 
| 15 | echo " Create a temporary named pipe and return its name." | |
| 16 | echo | |
| 17 | exit 1 | |
| 18 | } | |
| 19 | ||
| 20 | function fail() | |
| 21 | {
 | |
| 22 | echo "$1" >&2 | |
| 23 | exit 2 | |
| 24 | } | |
| 25 | ||
| 26 | ||
| 27 | ## main | |
| 28 | ||
| 29 | [ "$#" != 0 ] && usage | |
| 30 | ||
| 38253 
3d4e521014f7
Isabelle_Process: separate input fifo for commands (still using the old tty protocol);
 wenzelm parents: 
29143diff
changeset | 31 | #FIXME potential race condition wrt. future processes with same pid | 
| 28061 
5428435de53e
use hardwired /tmp -- fifo only work on local file-system;
 wenzelm parents: 
28047diff
changeset | 32 | FIFO="/tmp/isabelle-fifo$$" | 
| 38253 
3d4e521014f7
Isabelle_Process: separate input fifo for commands (still using the old tty protocol);
 wenzelm parents: 
29143diff
changeset | 33 | |
| 
3d4e521014f7
Isabelle_Process: separate input fifo for commands (still using the old tty protocol);
 wenzelm parents: 
29143diff
changeset | 34 | mkfifo -m 600 "$FIFO" || fail "Failed to create fifo: $FIFO" | 
| 28047 | 35 | echo "$FIFO" |