From: newsham AT aloha DOT net (Tim Newsham) Subject: Bug - O_CREAT 6 Dec 1996 18:50:31 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199612070121.PAA00796.cygnus.gnu-win32@haleakala.aloha.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Original-To: gnu-win32 AT cygnus DOT com X-Mailer: ELM [version 2.4 PL24 PGP3 *ALPHA*] Original-Sender: owner-gnu-win32 AT cygnus DOT com Hi, Stumbled across a problem in cygwin32. The open function does not behave as unix' open. In particular if an O_CREAT flag is passed and the file already exists, the file is truncated to zero length. The file should not be truncated as the O_TRUNC flag was not specified. As a test: #include main() { int fd = open("/tmp/foobar", O_RDWR | O_CREAT, 0666); close(fd); } echo foo > /tmp/foobar gcc test.c a.out ls -ld /tmp/foobar I am not on this list so please CC me any correspondance on the bug. Tim N. - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".