Re: cp creates directory with different permissions -- then reverts them
Re: cp creates directory with different permissions -- then reverts them
- Subject: Re: cp creates directory with different permissions -- then reverts them
- From: Jeffrey Ellis <email@hidden>
- Date: Mon, 30 Oct 2006 09:01:07 -0800
- Thread-topic: cp creates directory with different permissions -- then reverts them
Hi, Mike--
Thanks very much ;)
So here's the problem I'm having. In the app I'm doing, I use a call to cp
to make the copy. But unlike when using cp in terminal, somehow the
directory it's creating is a bit worse than normal. It has only System as
owner, and no access for anyone else. drwx------ chmod 700. Of course, this
changes when the copy is finished, but the user will be alerted as to the
initial settings of the folder, as it appears with a great big "No Access"
icon.
Can you suggest what I might be doing to cause this?
All My Best,
Jeffrey
on 10/30/06 5:20 AM, Michael Smith at email@hidden wrote:
>
> 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