This is the mail archive of the
cygwin
mailing list for the Cygwin project.
rm fails but returns success
- From: Peter Rosin <peda at lysator dot liu dot se>
- To: cygwin at cygwin dot com
- Date: Fri, 03 Feb 2012 17:02:59 +0100
- Subject: rm fails but returns success
Hi!
I have this annoying leftover file from a automake testsuite run.
I don't know if it was created by an MSYS process or a Cygwin
process, but I can't get rid of it. I can't take ownership of
it either, not even as admin. I haven't tried stopping all
MSYS/Cygwin processes yet, nor rebooting, but I'd rather not.
Any help with that is appreciated. No, not rebooting :-)
However, that is not really why I'm writing, I'm writing to
report the following bug related to the above file.
$ uname -a
CYGWIN_NT-6.1-WOW64 peda-pc 1.7.10s(0.259/5/3) 20120123 00:15:09 i686 Cygwin
$ ls -l aclibobj.log-t
-rw-r----- 1 ???????? ???????? 2113 Jan 31 16:09 aclibobj.log-t
$ rm aclibobj.log-t; echo $?
rm: remove write-protected regular file `aclibobj.log-t'? yes
0
$ ls -l aclibobj.log-t
-rw-r----- 1 ???????? ???????? 2113 Jan 31 16:09 aclibobj.log-t
$ rm -f aclibobj.log-t; echo $?
0
$ ls -l aclibobj.log-t
-rw-r----- 1 ???????? ???????? 2113 Jan 31 16:09 aclibobj.log-t
$ cacls aclibobj.log-t
C:\cygwin\home\peda\automake\tests\aclibobj.log-t
Access is denied.
$ getfacl aclibobj.log-t
# file: aclibobj.log-t
# owner: ????????
# group: ????????
user::rw-
group::r--
other:---
mask:rwx
$ cygcheck -c coreutils
Cygwin Package Information
Package Version Status
coreutils 8.14-1 OK
In an elevated PowerShell:
PS C:\cygwin\home\peda\automake\tests> takeown /F .\aclibobj.log-t
ERROR: Access is denied.
PS C:\cygwin\home\peda\automake\tests> del .\aclibobj.log-t
Remove-Item : Cannot remove item C:\cygwin\home\peda\automake\tests\aclibobj.log-t: Access to the path 'C:\cygwin\home\peda\automake\tests\aclibobj.log-t' is denied.
At line:1 char:4
+ del <<<< .\aclibobj.log-t
+ CategoryInfo : PermissionDenied: (C:\cygwin\home\...\aclibobj.log-t:FileInfo) [Remove-Item], UnauthorizedAccessException
+ FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand
Cheers,
Peter
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple