📄 cpfile.pas
字号:
{$I CPDIR.INC}
{*******************************************************************
* *
* COMPONENT for MS DOS and Windows source code. *
* *
* (c) 1992, Roderic D. M. Page *
* *
* Language: Turbo Pascal (Pascal with object-oriented extensions) *
* Compiler: Turbo Pascal 6.0 (MS DOS) *
* Turbo Pascal for Windows 1.0 (WINDOWS) *
* *
* Notes: Program interface is currently Windows specific. *
* *
*******************************************************************}
unit cpfile;
{*
Basic file utilities
17 Nov 1992 ValidPath added.
*}
interface
uses
Strings;
function Exist (szFileName : PChar):Boolean;
{True if file <\b szFileName> exists }
function ValidPath (szFileName: PChar):Boolean;
{True if file <\b szFileName> is a valid DOS path}
implementation
{ True if file szFileName exists }
function Exist (szFileName: PChar): Boolean;
var
i : Word;
f: text;
begin
{$I-}
Assign(f, szFileName);
Reset(f);
Exist := (IOResult = 0);
Close(f);
{Clear ioresult}
i := IOResult;
{$I+}
end;
{ True if path is valid }
function ValidPath (szFileName: PChar):Boolean;
var
i : Word;
f : text;
begin
{$I-}
Assign (f, szFileName);
Rewrite (f);
ValidPath := (IOResult = 0);
Close(f);
{Clear ioresult}
i := IOResult;
{$I+}
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -