rm seems to fail

Mark J. Reed markjreed@gmail.com
Tue Jan 13 19:53:00 GMT 2009


On Tue, Jan 13, 2009 at 1:57 PM, greenup wrote:
> dz@w2 ~
> $ rm -v goo/foo
> rm: remove write-protected regular empty file `goo/foo'? y
> removed `goo/foo'
>
> dz@w2 ~
> $ echo $?
> 0
>
> dz@w2 ~
> $ ls -la goo
> total 0
> drwxr-xr-x+  2 dz         mkgroup-l-d 0 Jan 13 08:10 .
> drwxrwx---+ 23 Administrators SYSTEM      0 Jan 13 10:01 ..
> -r--------   1 dz         mkgroup-l-d 0 Jan 13 08:18 foo

> obviously, LOTS AND LOTS of scripts and makefiles depend on rm -f.
> This is bad. (for me, at least)

Based on the above, the -f has nothing to do with it.   And this is
not a universal problem; rm has no trouble removing readonly files on
my Cygwin system, which is also 1.5.25.

Your cygcheck output indicates you have a C:\tools\unix\rm.exe in your
PATH; the Cygwin one is listed first by cygcheck, but it's worth
double-checking that you're executing the Cygwin one in the particular
shell environment where you're running these tests.

If it really is the Cygwin rm, it sounds like the unlink(2) call is
reporting success but not actually deleting the file.  That's easy to
check by calling unlink via a different route, e.g. perl -e
'unlink("goo/foo")' .

-- 
Mark J. Reed <markjreed@gmail.com>

--
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/



More information about the Cygwin mailing list