Re: Followup [was New bug: attachments are not being overwritten]

---------

From: Jose Kahan (jose.kahan@w3.org)
Date: Wed Jul 30 2003 - 04:02:06 CDT


Hi Daniel,

On Wed, Jul 30, 2003 at 07:18:17AM +0200, Daniel Stenberg wrote:
> On Tue, 29 Jul 2003, Jose Kahan wrote:
>
> > The solution is either to unlink the file if it already exists or remove the
> > O_CREAT flag and use a chmod afterwards to set the access rights.
> >
> > Which solution shall we adopt?
>
> My vote goes on the removal of the O_CREAT flag. But why do you need to chmod
> afterwards, open() sets the properties as the third argument specifies, right?

That's right. However, there was already a call to chmod right after
creating the file. Maybe this was added because of a portability
problem. I don't know why.

Anyway, I did some more tests and finally solved the problem. Rather
than suppressing the O_CREAT flag, I also added an O_TRUNK flag and
this did the trick.

I commited the change.

Thanks for your answer :)

-jose


---------

This archive was generated by hypermail 2.1.7.