Function 45h (69) Duplicate a File Handle (DUP)
Creates a new file handle by duplicating the existing handle of an
open file or device. The new handle shares the existing file pointer.
On entry: AH 45h
BX File handle
Returns: AX Duplicate file handle, or
Error code, if CF is set
Error Codes: 4 No handles available
6 Invalid handle
Call Function 59h for extended error code information
(DOS 3.0 and above).
--------------------------------------------------------------------------
Function 45h (DUP) returns a new file handle that refers to the same
file or device as the old file handle specified in BX.
Notes: Moving the file pointer of either handle by a Read,
Write, or Lseek causes the other handle to be
changed also. However, closing one handle does not
close the other.
By duplicating a handle and closing one of the
handles, you can flush the file to disk and update
the directory; since the other handle will still be
open, you won't need to re-open the file, a time-
consuming process.
Seealso:
This page last updated on Fri Nov 30 10:49:50 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster