This is the mail archive of the 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]
Other format: [Raw text]

gawk : Input file remaining locked after program termination


I have a gawk program that parses a file and spawns (as needed) an external
(non-gawk) program through the 'system(...)' built-in function. If the
external program remains active after gawk's termination, the file that was
used as the input to gawk remains locked and can not be modified.

Here is a code snippet the reproduces the issue :
(Put both files in a dir. where you have a few .txt files)

File :
ls *.txt > foobar
gawk -f bar.awk foobar >foobar.tmp
mv foobar.tmp foobar

File bar.awk :
	print $1 " OK";
	system("notepad " $1 " &");	

Running produced the following output :
mv: cannot create regular file `foobar': Permission denied

And, as a side-effect, the 'foobar' file is deleted. 

Would someone know whether this is a gawk issue ? a cygwin issue ? a port of
gawk to cygwin issue ? or my missing something ?

As a side note, I tried to change the system call to 
	system ("nohup " $1 " >/dev/null &")
but to no avail.

Thanks in advance for your help. 

Lionel Capiez
Ingénieur de développement
Tél. : 04 72 80 72 28
PROSODIE Lyon  - Direction des Moyens Informatiques
81, bd du Parc d'Artillerie  69007 Lyon
Tél. : 04 72 80 72 80 / Fax :

Unsubscribe info:
Bug reporting:

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