home *** CD-ROM | disk | FTP | other *** search
- {$B-,D-,F-,I+,N-,R-,S+,V+}
-
- (*
- Timo Salmi UNiT J
- A Turbo Pascal unit of file information and handling etc
- All rights reserved 24-Nov-81, 6-Dec-92, 19-Aug-92, 7-Nov-92
-
- In the 24-Nov-91 update of USUNTH unit part of its routines were
- transferred here to TSUTNTJ. The transferred routines were
- COPYFILE Copy a file from within a Turbo Pascal program
- ISDIRFN Is a name a directory or not
- OPENEDFN Is an assigned textfile still open or not
- PIPEDIFN Is the standard input from redirection
- PIPEDNFN Is the standard output redirected to nul
- PIPEDOFN Is the standard output redirected
-
- This unit may be used and distributed freely for PRIVATE, NON-COMMERCIAL,
- NON-INSTITUTIONAL purposes, provided it is not changed in any way. For
- ANY other usage, such as use in a business enterprise or a university,
- contact the author for the terms of registration.
-
- The units are under development. Comments and contacts are solicited. If
- you have any questions, please do not hesitate to use electronic mail for
- communication.
- InterNet address: ts@uwasa.fi (preferred)
- Bitnet address: SALMI@FINFUN.BITNET
-
- The author shall not be liable to the user for any direct, indirect or
- consequential loss arising from the use of, or inability to use, any unit,
- program or file howsoever caused. No warranty is given that the units and
- programs will work under all circumstances.
-
- Timo Salmi
- Professor of Accounting and Business Finance
- Faculty of Accounting & Industrial Management; University of Vaasa
- P.O. BOX 297, SF-65101 Vaasa, Finland
- *)
-
- unit TSUNTJ;
-
- (* ======================================================================= *)
- interface
- (* ======================================================================= *)
-
- uses Dos;
-
- (* ====================================================================
- File status information
- ==================================================================== *)
-
- (* This function returns whether a name is a directory or not.
- Avoid using this on an open file or standard devices. *)
- function ISDIRFN (name : string) : boolean;
-
- (* This function returns whether a name is a directory or not.
- Avoid using this on an open file or standard devices.
- An alternative method *)
- function ISDIR2FN (name : string) : boolean;
-
- (* This function returns whether a text file is open or closed.
- ^^^^
- Naturally the FilePointer must have been assigned at an earlier stage.
- Very convenient as a test in routines which close a file.
- e.g. use: if OPENEDFN(f) then close(f); *)
- function OPENEDFN (var FilePointer : text) : boolean;
-
- (* Is the standard input from redirection. Based on PC-Mag Vol 10 No 7, 374,
- Duncan 412, Dettmann 602-603 *)
- function PIPEDIFN : boolean;
-
- (* Is the standard output redirected. Based on PC-Mag Vol 10 No 7, 374,
- Duncan 412, Dettmann 602-603 *)
- function PIPEDOFN : boolean;
-
- (* Is the standard output redirected to nul. Based on PC-Mag Vol 10 No 7, 374,
- Duncan 412, Dettmann 602-603 *)
- function PIPEDNFN : boolean;
-
- (* ====================================================================
- Program information
- ==================================================================== *)
-
- (* Show the memory address where the interrupt is located *)
- procedure INTRLOCA (IntrNumber : byte;
- var segment : word;
- var offset : word);
-
- (* Show the memory address to which the interrupt points *)
- procedure INTRADDR (IntrNumber : byte;
- var segment : word;
- var offset : word);
-
- (* ====================================================================
- Perform tasks
- ==================================================================== *)
-
- (* Copy a file (of any type)
- Status codes:
- 0 : ok
- 1 : FromFile does not exits
- 2 : ToFile already exists
- 3 : ToFile cannot be opened for writing (read-only,
- write protected, invalid device)
- 4 : Error in writing to ToFile
- 5 : Copy error (disk probably full)
- 6 : Date stamp error
- 7 : Out of memory
- *)
- procedure COPYFILE (FromFile, ToFile : string; var status : byte);
-