This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

fd handle bug


Howdy all,

while porting a unix shell script suite, i came across an fd handler bug


A workarround is sufficiently easy, but nevertheless someone might be
able to fix it. It might be related to the readlink() bug, another file
descriptor bug reported recently here on the list by Wolfgang Guelcker
<wgue@berlin.snafu.de>. A bad feeling creeps up my back when i think of
all the  inexplicable errors that may stem from one single fd bug!

Here is the reduced script that works as expected on unix but on cygnus
B19 it gives that (un-)funny /dev/fd/6 error

I am running Chris Faylors patched version of cygwinb19.dll.

Keep on digging!

Erwin
-----------------------------------------

#!/bin/bash
e="end"
b="begin"
f=myfile
f=myfile

echo "some real data" > $f
#echo "$b" >> $f
#echo "some old data" >> $f
#echo "$e" >> $f

tmp=$f.tmp
echo "$b" > $tmp
echo "some tmp data" >> $tmp
echo "$e" >> $tmp

# this works on unix as expected
#cat $f <(grep -q "$e" <$f || echo "\n$b\n$e") | \
#	sed -e "/$e/ r $tmp" -e "/$b/,/$e/ d" > $f.new
# ---> leads to: $ cat: /dev/fd/6: No such file or directory


#workarround for cygnus
(grep -q "$e" <$f || echo "\n$b\n$e") | cat $f - | \
	sed -e "/$e/ r $tmp" -e "/$b/,/$e/ d" > $f.new




-- 
Erwin Achermann                               Tel:      ++41 1 632 74 40
Institut fuer Wissenschaftliches Rechnen      Fax:      ++41 1 632 11 72
ETH Zentrum, IFW C29.2         mailto:achermann@inf.ethz.ch  ICQ:4625051
CH-8092 Zuerich	               http://www.inf.ethz.ch/personal/acherman/
>  Perfection is reached, not when there is no longer anything to add, <
>  but when there is no longer anything to take away.                  <
>                                          -- Antoine de Saint-Exupery <
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]