This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using windows text mode without setup.exe

On Wed, 9 Apr 2008 at 11:51 -0700, mjumbe@... wrote:

....  The application needs read from and write to files in
text mode (i.e. using CRLF format).  This works fine on my development
machine, because I can just use the Cygwin setup program to specify
the Windows text mode as default.  However, when I package up my
distribution with the Cygwin dll and install it elsewhere, the program
writes UNIX linefeeds.

    In the open() function call, binary mode can be specified with the flag
    O_BINARY and text mode with O_TEXT. These symbols are defined in fcntl.h.

    In the fopen() function call, binary mode can be specified by adding
    a b to the mode string. Text mode is specified by adding a t to the
    mode string.

    The mode of a file can be changed by the call setmode(fd,mode) where fd
    is a file descriptor (an integer) and mode is O_BINARY or O_TEXT. The
    function returns O_BINARY or O_TEXT depending on the mode before the call,
    and EOF on error.

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]