Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: From: Capiez Lionel To: "'cygwin AT cygwin DOT com'" Subject: gawk : Input file remaining locked after program termination Date: Mon, 16 Dec 2002 14:26:13 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id gBGEfws27978 Hi, 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 foo.sh : ----------------- ls *.txt > foobar gawk -f bar.awk foobar >foobar.tmp mv foobar.tmp foobar File bar.awk : ------------------- { print $1 " OK"; system("notepad " $1 " &"); } Running foo.sh 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 -- Lionel Capiez Ingénieur de développement lcapiez AT prosodie DOT com 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 : 04.72.80.72.66 http://www.prosodie.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/