home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!almac!mike.dickson
- From: mike.dickson@almac.co.uk (Mike Dickson)
- Newsgroups: comp.lang.pascal
- Subject: Re: Avoiding system error
- Message-ID: <821.548.uupcb@almac.co.uk>
- Date: 23 Jan 93 17:04:00 GMT
- Reply-To: mike.dickson@almac.co.uk (Mike Dickson)
- Organization: Almac BBS Ltd. +44 (0)324 665371
- Lines: 27
-
- PP..try the following function (must have a USES DOS )
- PP.. Function Exist (aFile:String):Boolean;
- PP.. var Sr:SearchRec;
- PP.. begin
- PP.. FindFirst(aFile,ANYFILE-DIRECTORY-VOLUMEID,Sr);
- PP.. Exist:=DosError =0
- PP.. end;
-
- One small correction, possibly; instead of using FindFirst you could use
-
- FUNCTION FileExists (Filename : String) : Boolean;
- var
- Attr : Word;
- f : file;
- begin
- Assign (f, Filename);
- GetFAttr(f, attr);
- FileExists := (DOSError = 0);
- end;
-
- The reason for this is that there is a bug in the OS/2 Service Pak that
- prevents some instances of FindFirst from working.
-
- /\/\ | |< |. mike.dickson@almac.co.uk
- ---
- . SLMR 2.1a . Sex is better than logic, but I can't prove it.
-
-