delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/20/11:11:08

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL
X-Spam-Check-By: sourceware.org
Message-ID: <49C3C015.6080804@byu.net>
Date: Fri, 20 Mar 2009 10:11:01 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com, Martine DOT Carannante AT bull DOT net
Subject: Re: UNLINK problem (again!!)
References: <49C3BF14 DOT 5000602 AT bull DOT net>
In-Reply-To: <49C3BF14.5000602@bull.net>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Martine Carannante on 3/20/2009 10:06 AM:
> Hi
> 
> I kow that several persons have sent a mail concerning this problem, but
> unfortunately I don't see a clear solution in the mailing list.
> It seems to me very strange because  this kind of code happens very often .

Is this under cygwin 1.5 or 1.7?  It makes a difference, because the two
versions handle unlink() differently.  By default, Windows doesn't allow
deleting an open file (your code forgot to call fclose()).  Cygwin can
fake unlink() to make it appear that an open file has been deleted, but
the file still exists until it is closed, and depending on where the file
exists (which changes according to your cygwin version), the previous
existing file can be in the way of recreating a new file of the same name.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknDwA8ACgkQ84KuGfSFAYDwtACghwZxMNh4SpULRkCDZjaUeMx3
zvIAoL5DN4GTuOtXn+3e6poqp2ZuJM0I
=+qG1
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019