Date: Mon, 18 Sep 2000 16:52:35 -0400 Message-Id: <200009182052.QAA22284@envy.delorie.com> From: DJ Delorie To: djgpp-workers AT delorie DOT com In-reply-to: <200009182019.WAA26760@father.ludd.luth.se> (message from Martin Str|mberg on Mon, 18 Sep 2000 22:19:36 +0200 (MET DST)) Subject: Re: O_APPEND References: <200009182019 DOT WAA26760 AT father DOT ludd DOT luth DOT se> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Well how can I expect to preserve the O_APPEND flag here if I don't do > it as above? Or is my idea to make __file_handle_modes an array of > unsigned short instead of char completely wrong? "oldmode & ~(text|binary)" returns all the flags *except* text and binary. It will preserve the O_APPEND flag. You shouldn't use setmode() to set the O_APPEND flag. Use __file_handle_set() directly. You'll probably have to change both open/creat and _open/_creat.