author | wenzelm |
Fri, 29 Aug 2008 20:36:05 +0200 | |
changeset 28061 | 5428435de53e |
parent 28047 | 8dcf4349cf6f |
child 28650 | a7ba12e0d3b7 |
permissions | -rwxr-xr-x |
28047 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# $Id$ |
|
4 |
# Author: Makarius |
|
5 |
# |
|
6 |
# DESCRIPTION: create named pipe |
|
7 |
||
8 |
||
9 |
PRG="$(basename "$0")" |
|
10 |
||
11 |
function usage() |
|
12 |
{ |
|
13 |
echo |
|
14 |
echo "Usage: $PRG" |
|
15 |
echo |
|
16 |
echo " Create a temporary named pipe and return its name." |
|
17 |
echo |
|
18 |
exit 1 |
|
19 |
} |
|
20 |
||
21 |
function fail() |
|
22 |
{ |
|
23 |
echo "$1" >&2 |
|
24 |
exit 2 |
|
25 |
} |
|
26 |
||
27 |
||
28 |
## main |
|
29 |
||
30 |
[ "$#" != 0 ] && usage |
|
31 |
||
28061
5428435de53e
use hardwired /tmp -- fifo only work on local file-system;
wenzelm
parents:
28047
diff
changeset
|
32 |
FIFO="/tmp/isabelle-fifo$$" |
28047 | 33 |
mkfifo -m 600 "$FIFO" || fail "Failed to create named pipe $FIFO" |
34 |
echo "$FIFO" |