lib/Tools/mkfifo
author wenzelm
Tue, 21 Oct 2008 20:18:07 +0200
changeset 28650 a7ba12e0d3b7
parent 28061 5428435de53e
child 29143 72c960b2b83e
permissions -rwxr-xr-x
tuned usage line;

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


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

function usage()
{
  echo
  echo "Usage: isabelle $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"