This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Puzzling mv "permission denied" behaviour
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 5 Feb 2009 11:06:58 +0100
- Subject: Re: Puzzling mv "permission denied" behaviour
- References: <uhc3ars79.fsf@progress.com>
- Reply-to: cygwin at cygwin dot com
On Feb 4 13:07, Bob Erb wrote:
> I get a "permission denied" problem with mv that I don't understand
> when using mv to rename a directory. I have sufficient priveleges to
> mv the contents of the directory, and then, when empty, I can mv the
> directory. Why can I only mv the directory when it's empty, while I
> can mv the contents of the directory separately?
>
> Here's an illustration; I want to mv directory daily.18 to daily.19:
>
> $ ls # No daily.19 here.
> daily.0 daily.11 daily.14 daily.17 daily.3 daily.6 daily.9
> daily.1 daily.12 daily.15 daily.18 daily.4 daily.7
> daily.10 daily.13 daily.16 daily.2 daily.5 daily.8
> $ whoami
> rerb
> $ ls -ld # I have privs to mess around here.
> drwx------+ 21 rerb Domain Users 0 Feb 4 12:40 .
> $ ls -ld daily.18 # I've got full perms on daily.18.
> drwxr-xr-x+ 3 rerb Domain Users 0 Feb 4 12:56 daily.18
> $ mv daily.18 daily.19
> mv: cannot move `daily.18' to `daily.19': Permission denied
> $ ls -al daily.18 # What's in daily.18?
> total 0
> drwxr-xr-x+ 3 rerb Domain Users 0 Feb 4 12:56 .
> drwx------+ 21 rerb Domain Users 0 Feb 4 12:56 ..
> drwxr-x---+ 53 rerb Domain Users 0 Dec 18 18:02 home
> $ mv daily.18/home . # I can move the contents of daily.18.
> $ mv daily.18 daily.19 # I can move daily.18 when it's empty.
> $ mv home daily.19 # I can move the contents of daily.18 back into daily.19.
> $ mv daily.19 daily.18 # Why can't I move daily.19 back to daily.18?
> mv: cannot move `daily.19' to `daily.18': Permission denied
Works for me. One reason of this behaviour could be a process having
an open handle on something in this dir.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
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/