Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 12 Nov 2003 16:50:37 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: creat and open failing Message-ID: <20031112215037.GA8146@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <1068672677 DOT 3fb2a6a541e80 AT ecserv7 DOT uwaterloo DOT ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1068672677.3fb2a6a541e80@ecserv7.uwaterloo.ca> User-Agent: Mutt/1.4.1i Note-from-DJ: This may be spam On Wed, Nov 12, 2003 at 04:31:17PM -0500, y2bismil AT engmail DOT uwaterloo DOT ca wrote: >I got a question wrt to gcc and cygwin. I'm not sure if this is the defined >behaviour, but for some reason, the following code fails. This is a test >program which display the failure. >Running cygwin on windows 2000. Compiling with mingw (no-cygwin option) > >Basically, after creat...close... the file is set to read only (check >attributes under windows). This causes the second to fail. On the second run >of the program, the creat fails as well. Any idea why the file is being set to >read only? > >******************************************************** >#include >#include >#include > >int main() >{ > int handle; > handle= creat("hello.txt", O_WRONLY); ^^^^^^^^ This isn't the correct argument for creat. The second argument is the mode, as in what you send to chmod (2). -- Please use the resources at cygwin.com rather than sending personal email. Special for spam email harvesters: send email to aaaspam AT sourceware DOT org and be permanently blocked from mailing lists at sources.redhat.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/