Use of PG_BINARY_R and "r"

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Use of PG_BINARY_R and "r"
Date: 2002-03-22 18:43:32
Message-ID: 200203221843.g2MIhWh17514@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I am seeing conflicting usage of PG_BINARY_R and "r" in AllocateFile()
calls. Is there a logic of when to use one or the other, or is this
just badly maintained code?

The significant difference is:

#ifdef __CYGWIN__
#define PG_BINARY O_BINARY
#define PG_BINARY_R "rb"
#define PG_BINARY_W "wb"
#else
#define PG_BINARY 0
#define PG_BINARY_R "r"
#define PG_BINARY_W "w"
#endif

For example, in 7.2 I see pg_hba.conf opened with "r" and pg_ident.conf
opened with PG_BINARY_R.

My assumption is that text files should use "r" and binary files use
PG_BINARY_R.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ross J. Reedstrom 2002-03-22 19:00:37 Re: SET NULL / SET NOT NULL
Previous Message Bruce Momjian 2002-03-22 18:32:32 Re: Fw: Fw: bad performance on irix