Category : Pascal Source Code
Archive   : PASS_ALL.ZIP
Filename : TI188.ASC

 
Output of file : TI188.ASC contained in archive : PASS_ALL.ZIP








PRODUCT : TURBO PASCAL NUMBER : 188
VERSION : 3.02A
OS : PC-DOS, MS-DOS
DATE : October 9, 1986 PAGE : 1/2
TITLE : ADVANCED FILE HANDLINGT




The following information is presented for advanced users of
Turbo Pascal using MS-DOS or PC-DOS operating systems.

Turbo Pascal uses MS-DOS file handles to open files. Function
call 3DH is used. One of the parameters to this call is the "open
mode," which provides DOS with information about the way you
intend to access the file and what access to allow other
processes (in a networking or future multitasking environment).

Turbo Pascal normally uses an open mode byte of 2, which
designates Compatibility Mode with Read/Write Access and
Inheritance by child processes. By changing the value of this
byte to 0, you may open Read-only files. There may be other
applications for this, especially in a network environment.

Open mode byte for Reset & Rewrite (PC-DOS):

TURBO.COM CSEG:$24C6
TURBO-87.COM CSEG:$1F75
TURBOBCD.COM CSEG:$23CE

Open mode byte for Reset & Rewrite (MS-DOS):

TURBO.COM CSEG:$21EE
TURBO-87.COM CSEG:$1C9D
TURBOBCD.COM CSEG:$20F6

The best way to use this information is to create an absolute
variable pointing to the byte, for example:

var OpenModeByte: byte absolute CSeg:$24C6; (TURBO.COM PC-DOS)

For additional safety, make sure that the value of the byte being
changed is actually 2 before changing it. Remember, change it
back to 2 if you intend to do normal file opening intermixed with
opening of Read-only or shared files. Information on the
different attributes can be found in the DOS 3.0 Technical
Reference Manual.

{ Using TURBO.COM version 3.02 }

var OpenModeByte: byte absolute CSeg:$24C6; (TURBO.COM PC-DOS)















PRODUCT : TURBO PASCAL NUMBER : 188
VERSION : 3.02A
OS : PC-DOS, MS-DOS
DATE : October 9, 1986 PAGE : 2/2
TITLE : ADVANCED FILE HANDLING




Procedure AccessReadOnly;

begin
if not(OpenModeByte in [0, 2]) then
Error
else
OpenModeByte := 0;
end;

procedure AccessReadWrite;

begin
if not(OpenModeByte in [0, 2]) then
Error
else
OpenModeByte := 2;
end;

The open mode byte for overlay, chain, and execute files is
normally 0, Compatibility Mode with Read Access. The addresses
for these mode bytes can be found by searching the run-time
library for the bytes 00 3D. The first occurrence is the one used
for overlay files, and the second is used for Chain and Execute
files.



























  3 Responses to “Category : Pascal Source Code
Archive   : PASS_ALL.ZIP
Filename : TI188.ASC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/