4 # Script to make drag and drop in KDE possible
13 # Determine the temp directory
14 if [ -d "$TMPDIR" ] && [ -w "$TMPDIR" ]
17 elif [ -d "$TEMP" ] && [ -w "$TEMP" ]
24 # Try to create the temp files in a secure way
25 if [ -x /bin
/tempfile
]
27 out_file
=`/bin/tempfile -d "$tmp_dir" -p antiword -s ".ps"` ||
exit 1
28 err_file
=`/bin/tempfile -d "$tmp_dir" -p antiword -s ".err"`
34 elif [ -x /bin
/mktemp
]
36 out_file
=`/bin/mktemp -q -p "$tmp_dir" antiword.ps.XXXXXXXXX` ||
exit 1
37 err_file
=`/bin/mktemp -q -p "$tmp_dir" antiword.err.XXXXXXXXX`
44 # Creating the temp files in an un-secure way
45 out_file
=$tmp_dir"/antiword.$$.ps"
46 err_file
=$tmp_dir"/antiword.$$.err"
49 # Determine the paper size
53 # Make the PostScript file
54 antiword
-p $paper_size -i 0 "$@" 2>"$err_file" >"$out_file"
57 # Something went wrong
58 if [ -r "$err_file" ] && [ -s "$err_file" ]
60 konsole
--caption "Error from Antword" -e less "$err_file"
63 rm -f "$out_file" "$err_file"
67 # Show the PostScript file
68 gv
"$out_file" -nocentre -media $paper_size
71 rm -f "$out_file" "$err_file"