Date: Thu, 11 Mar 1999 10:56:32 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Junior System Administrator cc: djgpp AT delorie DOT com Subject: Re: File modes In-Reply-To: <199903101950.TAA01519@basil.restall.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 10 Mar 1999, Junior System Administrator wrote: > 1). Can I lock regions of memory in DJGPP without using assembly ? Of course. Use either __dpmi_lock_linear_region or _go32_dpmi_lock_code and _go32_dpmi_lock_data. > 2). Is there a portable way (conforming to the ANSI standard) to get > the mode of an already open file (opened with 'fopen()'). Is > there a function, or a field within the 'FILE *' type, that can > tell me ? What exactly do you mean by ``mode''? If you mean text/binary mode, then use `setmode' and pass it fileno(fp), where fp is a FILE * result returned by `fopen'. If you mean the read/write etc. mode bits, use fstat with the same fileno(fp) as an argument. Neither of these is ANSI, but `fstat' is Posix. Both have serious portability problems either to other DOS/Windows compilers (fstat and setmode) or to Unix (setmode).