home *** CD-ROM | disk | FTP | other *** search
- Unit JRDSK201 ;
-
- (*╔═════════════════════════════════════════════════════════════════════════╗*)
- (*║ ║*)
- (*║ JR Unit Library - Version 2.01 - June xxrd 1988 ║*)
- (*║ ║*)
- (*║ Disc functions and procedures ║*)
- (*║ ║*)
- (*╚═════════════════════════════════════════════════════════════════════════╝*)
-
- Interface
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Uses Dos ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Const _DOSService = $21 ;
-
- _first = True ; _next = False ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Var _regs8086 : Registers ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Function _ExistFile(_filename : String) : Boolean ;
- Function _FindFile(mask : String ; first : Boolean ;
- Var found : Boolean) : String ;
- Function _CurrentDrive : String ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Implementation
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
-
- Function _Dummy(_filename : String) : Boolean ;
- (* Version 1.02 *)
- (* *)
- (* Checks for files with any attribute set. *)
- (* Function published in PC Magazine, Nov 1987 *)
- (* Author : Paul A Neumann, Denver, Colorado *)
- (* *)
- Var _file_to_test : String ;
- Begin ;
- _file_to_test:=_filename+#0 ;
- With _regs8086 Do Begin ;
- ah:=$3D ; al:=$00 ;
- ds:=Seg(_file_to_test) ;
- dx:=Ofs(_file_to_test) ;
- End ;
- Intr(_DOSService,_regs8086) ;
- If ((_regs8086.flags OR $FFFE)=$FFFE) Then Begin ;
- (*If (Not _Bit(Lo(_regs8086.flags),0)) Then Begin ;*)
- _regs8086.bx:=_regs8086.ax ;
- _regs8086.ah:=$3E ;
- Intr(_DOSService,_regs8086) ;
- _Dummy:=True ;
- End Else _Dummy:=False ;
- End (* Function _ExistFile *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Function _ExistFile ;
- (* Version 1.02 *)
- Var _file : File ;
- Begin ;
- Assign(_file,_filename) ;
- (*$I-*)
- Reset(_file) ;
- (*$I+*)
- If (IOResult=0) Then Begin ;
- Close(_file) ;
- _ExistFile:=True ;
- End Else _ExistFile:=False ;
- End (* Function _ExistFile *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Function _FindFile ;
- (* Version 2.01 *)
- Var sr : SearchRec ;
- Begin ;
- If (first) Then FindFirst(mask,AnyFile,sr) Else FindNext(sr) ;
- found:=(DosError=0) ; _FindFile:=sr.Name ;
- End (* Function FindFile *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Function _CurrentDrive ;
- (* Version 1.02 *)
- Begin ;
- _regs8086.ah:=25 ;
- Intr(_DOSService,_regs8086) ;
- _CurrentDrive:=Chr(65+_regs8086.al)+':' ;
- End (* Function _CurrentDrive *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- End (* Of Unit JRDSK201 *).
-