lib/Tools/mkfifo
author wenzelm
Wed, 10 Sep 2008 23:19:36 +0200
changeset 28196 f019dd2db561
parent 28061 5428435de53e
child 28650 a7ba12e0d3b7
permissions -rwxr-xr-x
tuned;

#!/usr/bin/env bash
#
# $Id$
# Author: Makarius
#
# DESCRIPTION: create named pipe


PRG="$(basename "$0")"

function usage()
{
  echo
  echo "Usage: $PRG"
  echo
  echo "  Create a temporary named pipe and return its name."
  echo
  exit 1
}

function fail()
{
  echo "$1" >&2
  exit 2
}


## main

[ "$#" != 0 ] && usage

FIFO="/tmp/isabelle-fifo$$"
mkfifo -m 600 "$FIFO" || fail "Failed to create named pipe $FIFO"
echo "$FIFO"