Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
winetalk - named pipes for communication between wine and linux bash
# setup named pipes for wine<->linux shell communication
#
# APPLICATIONS: glue linux & wine, use linux in .bat scripts, system() C-calls etc
# USAGE:
#
# [linux]
# mkfifo /tmp/wine_in
# mkfifo /tmp/wine_out
# ./winetalk /tmp/wine_in /tmp/wine_out
#
# [in wine (dos)]
# echo ls>z:\tmp\wine_in
# type z:\tmp\wine_out
#
test $# -eq 3 || echo "Usage: $0 <infifoname> <outfifoname>"; exit;
wine_in="$1"
wine_out="$2"
if [ ! -p "$wine_in" ]; then mkfifo "$wine_in"; fi
if [ ! -p "$wine_out" ]; then mkfifo "$wine_out"; fi
if [ ! -p "$wine_in" ]; then echo "[!] could not make '$wine_in'"; exit; fi
if [ ! -p "$wine_out" ]; then echo "[!] could not make '$wine_in'"; exit; fi
(while [ 1 ]; do
cat < "$wine_in" | while read line; do
cmd=$(printf "$line"| sed 's/\r//g'); ($cmd) > "$wine_out";
done;
done ) &
echo "[x] done setting up wine pipes '$1' and '$2'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.