Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm Sender: cygwin-apps-owner AT cygwin DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps AT cygwin DOT com Delivered-To: mailing list cygwin-apps AT cygwin DOT com Date: Thu, 16 May 2002 12:52:24 +0200 From: Pavel Tsekov Reply-To: Pavel Tsekov Organization: Syntrex, Inc. X-Priority: 3 (Normal) Message-ID: <9212572768.20020516125224@syntrex.com> To: Robert Collins CC: cygwin-apps AT cygwin DOT com, cygwin-xfree AT sources DOT redhat DOT com Subject: Re[5]: setup.exe and inuse files for X In-Reply-To: <1276238290.20020516110649@syntrex.com> References: <1276238290 DOT 20020516110649 AT syntrex DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Ok, I've tested it on my WinXP Home on NTFS, FAT and FAT32. The following snippet removes the file no matter the filesystem (the Get/SetFileAttributes is required for FAT/FAT32 only): HANDLE hFile; DWORD dwAttr = GetFileAttributes ("test.dat"); SetFileAttributes ("test.dat", dwAttr & ~FILE_ATTRIBUTE_READONLY); hFile = CreateFile ("test.dat", DELETE, 0, NULL, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, NULL); CloseHandle (hFile); RC>> Does this work on FAT too? PT> I don't know - its not clear from the documentation. Someone has to PT> test it on FAT. However this combined with an an call to PT> SetFileAttributes () before it should be sufficient.