Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3E5D04C4.2B13671A@phekda.freeserve.co.uk> Date: Wed, 26 Feb 2003 18:17:40 +0000 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: fchmod, revision 3 [PATCH] References: <3E5CD60E DOT 63351BC4 AT phekda DOT freeserve DOT co DOT uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hello. Richard Dawe wrote: > > Richard Dawe wrote: > > > > Here's revision 3 of the fchmod patch. The only change is that > > it now returns ENOSYS, if the file name cannot be obtained > > from fd_props, as suggested by Eli. > > > > This needs testing on DOS and Windows 2000/XP. > [snip] > > Here are some results for DOS 7.1 (or whatever the DOS that comes with > Windows '98 SE is called): > > Using fchmod to change a file from read-write to read-only seems to work, as > long as you don't write to the file after the fchmod call. If you write > after fchmod(..., S_IRUSR), then the file reverts to read-write. I will add > a note to the fchmod info page. [snip] After a little more testing: Actually, if you write to the file at all, then the attributes will be read-write, when the file is closed. I also tried modifying the test program to fsync the file after the write calls, to ensure that all data had been written. This made no difference. Bye, Rich =] -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]