Mail Archives: djgpp-workers/2003/02/26/14:01:08

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <>
Date: Wed, 26 Feb 2003 18:17:40 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
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: <E18o0Zp-0000Vg-00 AT phekda DOT freeserve DOT co DOT uk> <3E5CD60E DOT 63351BC4 AT phekda DOT freeserve DOT co DOT uk>
Reply-To: djgpp-workers AT delorie DOT com


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.

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 [ ]

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019