Subject: Bug - O_CREAT
From: [email-masked] (Tim Newsham)

6 Dec 1996 18:50:31 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Original-To: [email-masked]
X-Mailer: ELM [version 2.4 PL24 PGP3 *ALPHA*]
Original-Sender: [email-masked]

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 <fcntl.h>

    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
"[email-masked]" with one line of text: "help".