From: earnie_boyd AT hotmail DOT com (Earnie Boyd) Subject: Re: BUG: Mingw32: _O_TRUNC 7 Apr 1998 09:01:17 -0700 Message-ID: <19980331132948.284.qmail.cygnus.gnu-win32@hotmail.com> Content-Type: multipart/mixed; boundary="====================987654321_0==_" To: gnu-win32 AT cygnus DOT com --====================987654321_0==_ Content-Type: text/plain; charset="us-ascii" Hi Mikey, >From: jeffdbREMOVETHIS AT goodnet DOT com (Mikey) >To: "Earnie Boyd" >Subject: Re: BUG: Mingw32: _O_TRUNC >Date: Tue, 31 Mar 1998 03:10:16 GMT >Reply-To: jeffdbREMOVETHIS AT goodnet DOT com > >See attached. I guess I need to be a MSDN member to do that. > >_O_TRUNC Opens file and truncates it to zero length; file must have write permission. >You cannot specify this flag with _O_RDONLY. _O_TRUNC used with _O_CREAT >opens an existing file or creates a new file. > >Did you do your test under bash or command.com? Results were the same under both. I'm on NT 3.51, I forget what build. The bits to the open mode are O_BINARY, O_WRONLY, O_CREAT, O_EXCL, and O_TRUNC. As I understand it, all of these should be able to be used together. I using JanJaap's 2.8.1 Mingw32 version to build. > >O_TRUNC open using msvcrt.dll causes write error >under bash (the file is set read only). I would expect that to be the case. > >0x200 is correct per MS, and does truncate the file. I'm glad to here it. > >Try testing under command.com > I did. Could you test the attached source using msvcrt and then crtdll? - \\||// ---o0O0--Earnie--0O0o---- -earnie_boyd AT hotmail DOT com- ------ooo0O--O0ooo------- ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com --====================987654321_0==_ Content-Type: application/x-unknown-content-type-FMA000_VIM-ViImprovedEditor; name="testopen_c" Content-Transfer-Encoding: x-uuencode Content-Disposition: attachment; filename="testopen_c" begin 644 testopen_c M(VEN8VQU9&4@/&EO+F@^#0HC:6YC;'5D92`\PT* M("!F<')I;G1F*'-T9&5R