home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 16
/
CD_ASCQ_16_0994.iso
/
news
/
573
/
3dlab101
/
binfiles.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-03-03
|
2KB
|
63 lines
{────────────────────────────────────────────────────────────────────────────}
{───This Unit contains (binary) file handling procedures.────────────────────}
{────────────────────────────────────────────────────────────────────────────}
{───( C ) Copyright 1993 By Kimmo Fredriksson.───────────────────────────────}
{────────────────────────────────────────────────────────────────────────────}
{$A+ Word Alignment }
{$B- Short-circuit Boolean expression evaluation }
{$D- Debug information off }
{$E- Disable 80x87 run-time library }
{$F- Force Far Calls off }
{$G+ 80286 instructions }
{$I- I/O checking off }
{$L- Local Symbols off }
{$N- Calc reals by software }
{$O- Overlays not allowed }
{$P- Open string parameters disabled }
{$Q- Overflow Check off }
{$R- Range-checking off }
{$S- Stack-checking off }
{$T- Type-Check pointers off }
{$V- Strict Var-String off }
{$X+ Extended Syntax on }
UNIT BinFiles;
INTERFACE
FUNCTION FOpenRead( VAR f : FILE; CONST fn : STRING ) : Boolean;
FUNCTION FOpenWrite( VAR f : FILE; CONST fn : STRING ) : Boolean;
IMPLEMENTATION
{─Assign file f to filename fn, and try to open that file for reading────────}
FUNCTION FOpenRead( VAR f : FILE; CONST fn : STRING ) : Boolean;
VAR IOErr : Integer;
BEGIN
Assign( f, fn );
ReSet( f, 1 );
IOErr := IOResult;
FOpenRead := IOErr = 0
END;
{─Assign file f to filename fn, and try to open that file for writing────────}
FUNCTION FOpenWrite( VAR f : FILE; CONST fn : STRING ) : Boolean;
VAR IOErr : Integer;
BEGIN
Assign( f, fn );
ReWrite( f, 1 );
IOErr := IOResult;
FOpenWrite := IOErr = 0
END;
{ INITIALIZATION }
END.