• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: cp creates directory with different permissions -- then reverts them
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cp creates directory with different permissions -- then reverts them


  • Subject: Re: cp creates directory with different permissions -- then reverts them
  • From: Michael Smith <email@hidden>
  • Date: Mon, 30 Oct 2006 05:20:42 -0800


On Oct 29, 2006, at 11:06 PM, Jeffrey Ellis wrote:

I have just noticed that when doing a copy of a directory, the copy of the
directory has different owner/group and permissions than the original, and
when done, has reverted back to the original permissions.


This was my test directory. Here is my output during the initial stage, just
after copying has begun:


drwxr-xr-x    4 root     admin   136 Oct 29 22:56 Mixdown Project

And when the copy was complete:

drwxrwxrwx    8 jeffrey  jeffrey   272 May  6  2005 Mixdown Project

I was sudo'd to do the cp.

Can someone tell me why cp is doing this?

There are several reasons.

Firstly, the mkdir(2) system call does not provide a way for the owner/group to be set on the destination (since that would only be useful to root, anyway).

Secondly, the directory has to be left as it was created until the copy is complete because the final mode for the directory may preclude creating files within it.

Those two cover most cases.

 = Mike

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: cp creates directory with different permissions -- then reverts them
      • From: Jeffrey Ellis <email@hidden>
References: 
 >cp creates directory with different permissions -- then reverts them (From: Jeffrey Ellis <email@hidden>)

  • Prev by Date: Re: cp creates directory with different permissions -- then reverts them
  • Next by Date: Re: cp creates directory with different permissions -- then reverts them
  • Previous by thread: Re: creation date vs ctime
  • Next by thread: Re: cp creates directory with different permissions -- then reverts them
  • Index(es):
    • Date
    • Thread