                           Ŀ
                             DOS70 Version 1.2  
                           
                                   Manual 
                                  

                       Copyright (C) by Cristi Streng
                                September 1997

   


CONTENTS 


   Chapter 1: Long Filenames (LFNs)
   ---------
     1.1. Working with files
     1.2. Working with directories
     1.3. Searching for files
     1.4. File dates, sizes, attributes
     1.5. Retrieving file info

   Chapter 2: DOS Extensions
   ---------
     2.1. Extended file functions
     2.2. Media functions

   Chapter 3: Virtual Machine Services
   ---------
     3.1. Window Titles
     3.2. Close-Aware Applications
     3.3. Miscellaneous functions

   Chapter 4: Reference
   ---------
     4.1. Procedures and Functions
     4.2. Constants, Variables and Types

   

CHAPTER 1: LONG FILENAMES 


1.1. Working with files.
-----------------------

   First of all, a file, as defined in the DOS70 unit, is not equivalent to
a Turbo Pascal file. You cannot use the standard read(ln) or write(ln)
functions to read or write files opened or created with functions in the
DOS70 unit, and you cannot use the new read and write functions with files
opened with reset or rewrite. The DOS70 unit's file is declared as word:

   type LFNFile=word;

while the 'file' type in Pascal is more complex because it contains some
information about the file (as date&time, attributes, status), not only a
handle to the file. I would be eternally grateful to anyone who could
send me some information about the structure of Turbo Pascal FILEs..
   That is the reason why I haven't included in this unit any procedures
equivalent to 'Read' or 'Write'; there are only equivalents to 'BlockRead'
and 'BlockWrite'.

   Working with files involves the following operations:

   - creating files     : LFNCreateFile - specify attributes, sharing, etc.
   - opening files      : LFNOpenFile
   - truncating files   : LFNTruncateFile - specify attributes, sharing, etc.
   - closing files      : LFNCloseFile
   - reading from files : LFNBlockRead
   - writing into files : LFNBlockWrite
   - seeking            : LFNSeek
   - renaming files     : LFNRename
   - deleting files     : LFNErase - now you can use wildcards
   - truncate a file and open for write: LFNRewrite
   - open a file for read: LFNReset
   - open a file for append: LFNAppend

   These functions and procedures are similar to the ones included in
Pascal. See the reference for details. The following are equivalent:

   LFNRewrite (fn)    with LFNTruncFile (fn, FA_NORMAL, OPEN_WRONLY +
                                                     OPEN_AUTOCREATE, 0);
   LFNReset (fn)      with LFNOpenFile (fn, FA_NORMAL, OPEN_RDONLY, 0);
   f:=LFNAppend (fn)  with f:=LFNOpenFile (fn, FA_NORMAL, OPEN_WRONLY, 0);
                           LFNSeek (f, SEEK_END, 0);

   In addition to these, I can include here the 'LFNGenShortName' function,
which generates a short name for the specified long file name.

   Please note that all the functions work only in Windows 95 or newer, you
cannot use them while running DOS < 7.0 or/and Windows 3.x. The functions
won't work even when you have Windows 95 and DOS 7.0, but you are in MS-DOS
mode (by choosing 'Command prompt' in the startup menu or 'Shut Down' ->
'Restart the computer in MS-DOS mode').

1.2. Working with directories.
-----------------------------

   Functions for working with directories :

   - creating a directory           : LFNMkDir
   - deleting an empty directory    : LFNRmDir
   - changing the current directory : LFNChDir
   - getting the current directory  : LFNGetDir

   Again, the syntax of these functions is very similar to the syntax of
the functions in System unit.

   Starting with DOS 7.0, you can safely associate paths with drive letters
by using the Substitute functions:

   - creating an association                         : CreateSubst
   - removing an association                         : TerminateSubst
   - getting the path associated with a drive letter : GetSubst

1.3. Searching for files.
------------------------

   There are some improvements in file searching starting with DOS 7.0.
   The LFNFindFirst function accepts two Attribute parameters: MustAttrs
and SearchAttrs. MustAttrs are attributes that a found file must match, and
SearchAttrs are attributes to search for. I'll explain to you how these work.
Here is the algorithm:

   if ((MustAttrs and (not Attributes)) and $3F=0) and
      (((not SearchAttrs) and Attributes) and $1E=0) then

      { OK - File found }

   else

      { File not found }

   In this algorithm, 'Attributes' represents the attributes of a file being
analized by the LFNFindFirst/LFNFindNext functions. As you see here, bits 0
and 5 (that is, FA_ARCHIVE and FA_RDONLY) in SearchAttrs are not used - the
LFNFindFirst/LFNFindNext functions work as if these attributes are always set
in SearchAttrs.

   Here is a list of some commonly used values for MustAttrs and SearchAttrs
and the result (if the specified filename is "*.*"):

MustAttrs          SearchAttrs       Result
--------------------------------------------------------
$00 (FA_NORMAL)    $3F (FA_ANY)      All files and directories (including
                                     hidden, etc.)
$00 (FA_NORMAL)    $00 (FA_NORMAL)   Normal files (not including hidden or
                                     system or directories, but including
                                     archive and readonly)
$01 (FA_RDONLY)    $01 (FA_RDONLY)   Only read-only files
$02 (FA_HIDDEN)    $02 (FA_HIDDEN)   Only hidden files
$02 (FA_HIDDEN)    $06 (FA_HIDDEN+   All hidden files and (hidden and system)
                        FA_SYSTEM)   files
$00 (FA_HIDDEN)    $06 (FA_HIDDEN+   All hidden or system files
                        FA_SYSTEM)
$00 (FA_HIDDEN)    $16 (FA_DIR+      All hidden or system files or directories
                        FA_HIDDEN+
                        FA_SYSTEM
$00 (FA_NORMAL)    $10 (FA_DIR)      All normal files and directories
$00 (FA_NORMAL)    $2F (FA_ANY-      All files (but not directories)
                        FA_DIR)
$10 (FA_DIR)       $10 (FA_DIR)      All normal directories
$10 (FA_DIR)       $3F (FA_ANY)      All directories
$08 (FA_VOLUME)    $08 (FA_VOLUME)   The volume label
$20 (FA_ARCHIVE)   $3F (FA_ANY)      Files and directories with the archive
                                     attribute set
--------------------------------------------------------

   I hope you can manage with this kind of attribute masking. It is more
difficult, but more powerful than the old type of masking. Please use the
same mode of attribute masking in the LFNErase function if you use
wildcards.

   After you have finished searching for files, you MUST use the
LFNFindClose procedure to free the handle that you used during the search.
Unlike old MS-DOS FindFirst function, the LFNFindFirst function allocates
internal storage for search operations. The LFNFindClose procedure must be
called to free this internal storage.

   The search is more flexible now, for example you can use the '*pas*' mask
to search for all the filenames that contain (either in the long name or in
the 8.3 format name) the text 'pas'. In the old versions of MS-DOS, all the
characters after the first asterisk are ignored, so the '*pas*' mask would
be equivalent to '*'.

   You can use the following algorithm for searching files in a directory (of
course you should add some DOSError checking after LFNChDir):

   LFNChDir ('Directory');
   f := LFNFindFirst ('Mask', MustAttrs, SearchAttrs, FindData);
   while DOSError = 0 do
   begin
     { process FindData here }
     LFNFindNext (f, FindData)
   end;
   LFNFindClose (f);

1.4. File dates, sizes and attributes.
-------------------------------------

   On Windows 95 systems, files have 3 dates, not one, like in older MS-DOS:
      Creation Date&Time = The time the file was created. Set on file
                           creation. Accuracy = tenths of milliseconds.
      Last Access Date   = The date the file was last opened for read or
                           write. Accuracy = 1 day.
      Modification (Last Write) Date&Time = The time the file was last opened
                           for write. Accuracy = 2 seconds.

   Functions in the DOS70 unit:
      LFNGetAccessTime Ŀ
      LFNSetAccessTime Ĵ
      LFNGetCreateTime  used with file names
      LFNSetCreateTime Ĵ
      LFNGetModifTime  Ĵ
      LFNSetModifTime  
      LFNHGetAccessTime Ŀ
      LFNHSetAccessTime Ĵ
      LFNHGetCreateTime  used with file handles
      LFNHSetCreateTime Ĵ
      LFNHGetModifTime  Ĵ
      LFNHSetModifTime  
      LFNPhysicalFileSize - calculate the space occupied by a compressed file
      LFNGetAttrib - get file attributes
      LFNSetAttrib - set file attributes
      FileTimeToDOSTime - convert from file time to DOS time
      DOSTimeToFileTime - convert from DOS time to file time

   File time is represented as a 64-bit integer, while the DOS time is a
structure. The last two functions are used in the code for LFNFindFirst/Next.

1.5. Retrieving file info.
----------------------

   The DOS70 unit includes some functions for retrieving file informations.
   The most important of them is 'GetVolumeInformation'. GetVolumeInformation
returns the maximum file name length, the maximum path length, the file
system name and type. For a typical FAT volume, the values are:
      MaxFileSize=255;
      MaxPath=260;
      Flags=FS_CASE_PRESERVED+FS_LFN_UNICODE_USED+FS_LFN_APIS;
      Name='FAT'.
   For a FAT-32 system (Windows 95 OSR2) - Name='FAT32'
   For a CD - Name='CDFS'.

   As you see, the maximum path length is 260 characters, which exceeds the
maximum size of a string (255 characters). The solution to this problem (to
this bug) would be the use of PChar strings instead of standard strings, but
I have chosen to use standard strings because they are easier to use and
because the problem is very unlikely to appear (who uses paths of over 255
characters ?). Anyway, in the future versions I might use PChar strings
instead of standard strings (please tell me your opinion: PChars or strings?)

   Other functions and procedures:
   GetFullPathName Ŀ   GetFullPathName and GetShortPathName return the full
   GetShortPathName  path of a file (in 8.3 format). GetLongPathName
   GetLongPathName    returns the full path of a file in LFN format.

   

CHAPTER 2: DOS EXTENSIONS 


2.1. Extended file functions.
----------------------------

   GetCompressedFileSize - calculate the actual space occupied by the
                           file (either it is compressed or not)
   GetFirstCluster       - retrieve the first cluster of the file
   GetSwapFileInfo       - retrieve information about the swap file
   ExtOpenFile           - open a file (attributes and sharing specified)
   ExtCreateFile         - create a file
   ExtTruncFile          - truncate a file
   DOS7Rewrite           - instead of Rewrite()
   DOS7Reset             - instead of Reset()
   DOS7Append            - instead of Append()
   FlushBuffers          - flushes the file system buffers.
   FlushCache            - flushes the file system buffers and cache.

   The ExtOpenFile, ExtCreateFile and ExtTruncFile can be used in other
versions of DOS, but they do not accept the OPEN_RO_NOMOD opening mode and
some DOS 7 specific flags. The following are equivalent:
   f:=DOS7Rewrite (filename) with f:=ExtTruncFile (filename, FA_NORMAL,
                                              OPEN_WRONLY+OPEN_AUTOCREATE);
   f:=DOS7Reset (filename)   with f:=ExtOpenFile (filename, FA_NORMAL,
                                              OPEN_RDONLY);
   f:=DOS7Append (filename)  with f:=ExtOpenFile (filename, FA_NORMAL,
                                              OPEN_WRONLY);
                                     LFNSeek (filename, SEEK_END, 0);

   All the LFN functions that work with file handles can be used with files
created or opened with Ext***File (including LFNCloseFile to close these
files). Anyway I don't recommend that you use these functions; use LFN***File
instead.

2.2. Media functions.
--------------------

   LockMedia       - locks a volume in a drive (preventing its removal)
   UnlockMedia     - unlocks a volume in a drive (permitting its removal)
   GetLockCount    - returns the locked status of a drive (number of locks
                     pending on the drive)
   EjectMedia      - ejects the specified media.
   GetDriveMapInfo - retrieves informations about a drive.

   

CHAPTER 3: VIRTUAL MACHINE SERVICES 


3.1. Window Titles.
------------------

   These functions and procedures can be used by an application to
retrieve or change the title of the window in which the application runs.
   The title of an MS-DOS window consists of three strings: a virtual machine
state, a virtual machine title and an application title, separated by a
hyphen. The virtual machine state can be set by the OS only is frequently an
empty string. It identifies whether the VM is inactive or whether the user
is carrying out some tasks, as cut and paste operations. The virtual machine
title and the application title can be set using the SetVMTitle and
SetApplicationTitle procedures and can be retrieved using the GetVMTitle and
GetApplicationTitle functions.

3.2. Close-Aware Applications.
-----------------------------

   A close-aware application is an application that can respond to the
selection of the "Close" command from the system menu of the window it is
running in. A close-aware application enables the "Close" command, which can
be an alternate way to exit the application and save the settings.You can
enable or disable the Close command by using EnableClose or DisableClose.
After you have enabled the Close command, your application must periodically
check the close flag using the QueryClose function. This function returns
CL_NOTACK if the user has selected the Close command from the system menu.
   After the QueryClose function returns CL_NOTACK, the application should
call AcknowledgeClose. If the application does not call this function within
a system-defined amount of time, the system resets the close flag. After
acknowledging the close state, an application should take all necessary
steps to save the settings and then exit, or it should cancel the close by
calling the CancelClose procedure. After the close has been acknowledged,
the QueryClose function returns CL_ACK.
   I have included an example to see how these work.

3.3. Miscellaneous functions.
----------------------------

   This version of DOS70 includes a bug-fixed IsDOS70 function and the new
GetVer and GetWinVer functions to retrieve the version of DOS or Windows.
   Other new functions or procedures:
      SetFocus   - makes the current VM active.
      SetFocusTo - makes the specified VM active.
      GetVMID    - retrieves the ID of the current VM.
   The SetFocusTo function would be more useful if there were a way to
retrieve the ID of any virtual machine (you can retrieve only the ID of the
current VM). I'm working on this.

   

CHAPTER 4: REFERENCE 


4.1. Procedures and Functions.
-----------------------------

4.1.1. DOS Extensions:

   
    IsDOS70 
   

   Declaration:
   ---   function IsDOS70: boolean;   ---

   Find out whether you can use the other functions and procedures in this
   unit.

   Parameters: NONE
   ----------

   Returns: True  if you are using DOS 7.x (Windows 95) and you have loaded the
   -------        graphical interface.
            False if your DOS version is less than 7.0 or you are in MS-DOS
                  mode.

   ------------------------------------------------------------------------
   All the following functions and procedures set the DOS7Error to a
   non-zero value in case of an error. See DOS7Error variable reference for
   a list of possible errors.
   ------------------------------------------------------------------------

   
    GetVer 
   

   Declaration:
   ---   procedure GetVer (var major:byte;    ---
                           var minor:byte);

   Retrieves the DOS version.

   Parameters: major - the major DOS version number (set by the procedure)
   ----------  minor - the minor DOS version number (set by the procedure)

   Returns: the major and minor DOS version numbers.
   -------

   
    GetWinVer 
   

   Declaration:
   ---   procedure GetWinVer (var major:byte;    ---
                              var minor:byte);

   Retrieves the version of Windows (4.0 for Windows95).

   Parameters: major - the major version of Windows (set by this function)
   ----------  minor - the minor version of Windows (set by this function)

   Returns: The version of Windows running.
   -------

   
    GetCompressedFileSize 
   

   Declaration:
   ---   function GetCompressedFileSize (PathName:string):longint;   ---

   Calculates the size occupied by a file or directory. This function
   obtains the actual number of bytes of disk storage used to store the file
   If the file is locate on a compressed volume and is compressed, the value
   obtained is the compressed size of the file. If the file is not
   compressed, the value obtained is the file size, rounded up to the
   nearest cluster boundary.

   Parameters: PathName - the file or directory to retrieve the size for
   ----------

   Returns: the file or directory size.
   -------

   
    LockMedia 
   

   Declaration:
   ---   function LockMedia (Drive:byte):byte;   ---

   Locks the volume in the given drive (preventing its removal).

   Parameters: Drive - drive to lock. Can be 0 for the default drive, 1 for
   ----------          A, 2 for B, etc.

   Returns: the number of locks pending on the drive.
   -------

   
    UnlockMedia 
   

   Declaration:
   ---   function UnlockMedia (Drive:byte):byte;   ---

   Unlocks the volume in the given drive (permitting its removal).

   Parameters: Drive - drive to unlock. Can be 0 for the default drive, 1
   ----------          for A, 2 for B, etc.

   Returns: the number of locks pending on the drive.
   -------

   
    GetLockCount 
   

   Declaration:
   ---   function GetLockCount (Drive:byte):byte;   ---

   Parameters: Drive - drive to get lock count of. Can be 0 for default, 1
   ----------          for A, 2 for B, etc.

   Returns: the number of locks pending on the drive.
   -------

   
    EjectMedia 
   

   Declaration:
   ---   procedure EjectMedia (Drive:byte):byte;   ---

   Ejects the specified media.

   Parameters: Drive - drive to eject. Can be 0 for default, 1 for A, 2 for
   ----------          B, etc.

   
    GetDriveMapInfo 
   

   Declaration:
   ---   procedure GetDriveMapInfo (Drive:byte;              ---
                                    var MapInfo:TMapInfo);

   Retrieves information about the specified drive.

   Parameters: Drive - drive to retrieve information about (0 = default,
   ----------          1 = A, 2 = B, etc.).
               MapInfo - a TMapInfo structure that receives information
                         about the drive (see TMapInfo in section 4.2).

   
    GetFirstCluster 
   

   Declaration:
   ---   function GetFirstCluster (PathName:string;        ---
                                   CharSet:byte):longint;

   Retrieves the first cluster occupied by a file or directory.

   Parameters: PathName - file or directory to retrieve the first cluster
   ----------             for
               CharSet - the character set for PathName (see constants in
                         section 4.2).

   Returns: the first cluster of the specified file or directory.
   -------

   
    GetSwapFileInfo 
   

   Declaration:
   ---   procedure GetSwapFileInfo (var SwapInfo:TSwapInfo);   ---

   Retrieves information about the swap file.

   Parameters: SwapInfo - a TSwapInfo structure that receives information
   ----------             about the swap file (see section 4.2).

   
    ExtOpenFile 
   

   Declaration:
   ---   function ExtOpenFile (FileName:string;    ---
                               Attributes:word;
                               Flags:word):word;

   Opens an existing file for read or write. This function fails if the file
   does not exist and OPEN_AUTOCREATE flag is not used.

   Parameters: FileName - file to open. The file name must be
   ----------             in the 8.3 format. If you want to use long file
                          names, see LFNOpenFile.
               Attributes - attributes of the new file (if OPEN_AUTOCREATE).
               Flags - see section 4.2.

   Returns: a handle to the opened file. The handle is a 16-bit value and is
   -------  used in read, write, seek, close, file date and attributes
            management LFN functions.

   
    ExtCreateFile 
   

   Declaration:
   ---   function ExtCreateFile (FileName:string;    ---
                                 Attributes:word;
                                 Flags:word):word;

   Creates a file and opens it for read/write. This function fails if the
   file already exists.

   Parameters: FileName - file to create. The file name must be
   ----------             in the 8.3 format. If you want to use long file
                          names, see LFNCreateFile.
               Attributes - attributes of the new file.
               Flags - see section 4.2.

   Returns: a handle to the created file. The handle is a 16-bit value and
   -------  is used in read, write, seek, close, file date and attributes
            management LFN functions.

   
    ExtTruncFile 
   

   Declaration:
   ---   function ExtTruncFile (FileName:string;    ---
                                Attributes:word;
                                Flags:word):word;

   Opens a file and truncates it to zero length (replaces the file). This
   function fails if the file does not exist and OPEN_AUTOCREATE is not used.

   Parameters: FileName - file to truncate. The file name must be
   ----------             in the 8.3 format. If you want to use long file
                          names, see LFNTruncateFile.
               Attributes - attributes of the new file.
               Flags - see section 4.2.

   Returns: a handle to the truncated file. The handle is a 16-bit value and
   -------  is used in read, write, seek, close, file date and attributes
            management LFN functions.

   
    DOS7Rewrite 
   

   Declaration:
   ---   function DOS7Rewrite (FileName:string):word;   ---

   Opens a file for write only. Truncates the file if it already exists and
   creates it if it does not exist.

   See LFNTruncFile and section 2.1 for more details.

   
    DOS7Reset 
   

   Declaration:
   ---   function DOS7Reset (FileName:string):word;   ---

   Opens a file for read only. Fails if the file does not exist.

   See LFNOpenFile and section 2.1 for more details.

   
    DOS7Append 
   

   Declaration:
   ---   function DOS7Append (FileName:string):word;   ---

   Opens a file for write only. Fails if the file does not exist; moves the
   file pointer to the end of the file otherwise.

   See LFNOpenFile and section 2.1 for more details.

   
    FlushBuffers 
   

   Declaration:
   ---   procedure FlushBuffers (Drive:byte);   ---

   Flushes file system buffers for a specified drive.

   Parameters: Drive - drive to reset (flush the buffers). Can be 0 for the
   ----------          default drive, 1 for A, 2 for B, etc.

   
    FlushCache 
   

   Declaration:
   ---   procedure FlushCache (Drive:byte);   ---

   Flushes file system buffers and cache for a specified drive.

   Parameters: Drive - drive to reset (flush the buffers and cache). Can be
   ----------          0 for the default drive, 1 for A, 2 for B, etc.


4.1.2. Virtual Machine Services

   
    SetFocus 
   

   Declaration:
   ---   procedure SetFocus;   ---

   Makes the current Virtual Machine active. For an MS-DOS VM, it makes the
   program run in full-screen mode.

   Parameters: NONE
   ----------

   
    SetFocusTo 
   

   Declaration:
   ---   procedure SetFocusTo (VMID:word);   ---

   Makes the specified Virtual Machine active. For an MS-DOS VM, it makes
   the program run in full-screen mode.

   Parameters: VMID - a Virtual Machine ID. Can be retrieved with GetVMID.
   ----------

   
    GetVMID 
   

   Declaration:
   ---   function GetVMID:word;   ---

   Retrieves the ID of the current Virtual Machine.

   Parameters: NONE
   ----------

   Returns: the ID of the current Virtual Machine.
   -------

   
    GetApplicationTitle 
   

   Declaration:
   ---   function GetApplicationTitle:string;   ---

   Retrieves the title of the running application.

   Parameters: NONE
   ----------

   Returns: the title of the current application.
   -------

   
    SetApplicationTitle 
   

   Declaration:
   ---   procedure SetApplicationTitle (title:string);   ---

   Sets the title of the running application.

   Parameters: title - the new application title. Should be less than 80
   ----------          characters long.


   
    GetVMTitle 
   

   Declaration:
   ---   function GetVMTitle:string;   ---

   Retrieves the title of the running virtual machine.

   Parameters: NONE
   ----------

   Returns: the title of the current virtual machine.
   -------

   
    SetVMTitle 
   

   Declaration:
   ---   procedure SetVMTitle (title:string);   ---

   Sets the title of the running virtual machine.

   Parameters: title - the new VM title. Should be less than 30 characters
   ----------          long.

   
    AcknowledgeClose 
   

   Declaration:
   ---   procedure AcknowledgeClose;   ---

   Acknowledges the close state of the close flag for the current window.
   Acknowledging the close state is necessary if an application needs to
   perform keyboard input before exitting. If the close state has not been
   acknowledged, all keyboard read operations will fail.

   Parameters: NONE
   ----------

   
    CancelClose 
   

   Declaration:
   ---   procedure CancelClose;   ---

   Cancel the close operation. This procedure should be called after
   acknowledging the close state of the close flag.

   Parameters: NONE
   ----------

   
    EnableClose 
   

   Declaration:
   ---   procedure EnableClose;   ---

   Enables the Close command in the system menu.

   Parameters: NONE
   ----------

   
    DisableClose 
   

   Declaration:
   ---   procedure DisableClose;   ---

   Disables the Close command in the system menu.

   Parameters: NONE
   ----------

   
    QueryClose 
   

   Declaration:
   ---   function QueryClose:byte;   ---

   Indicates whether the user has attempted to close an application by
   choosing the Close command from the system menu.

   Parameters: NONE
   ----------

   Returns: CL_NOTACK - if the close command was chosen and the application
   -------              has not acknowledged the close state.
            CL_ACK    - if the close command was chosen and the application
                        has acknowledged the close state.
            CL_NOT    - if the close command has not been chosen.


4.1.3. LFN Functions

   
    FileTimeToDOSTime 
   

   Declaration:
   ---   procedure FileTimeToDOSTime (FileTime:comp;         ---
                                      var DT:NewDateTime);

   Unpacks the file time included in the 64-bit value FileTime into
   DT.

   Parameters: FileTime - a 64-bit integer representing the file time.
   ----------  DT - a NewDateTime structure (see section 4.2 for details).

   
    DOSTimeToFileTime 
   

   Declaration:
   ---   procedure DOSTimeToFileTime (DT:NewDateTime;       ---
                                      var FileTime:comp);

   Packs the time included in DT into FileTime.

   Parameters: DT - a NewDateTime structure (see section 4.2 for details).
   ----------  FileTime - a 64-bit integer (the file time).

   
    LFNMkDir 
   

   Declaration:
   ---   procedure LFNMkDir (NewDir:string);   ---

   Creates a directory with the specified long name.

   Parameters: NewDir - the path of the new directory (may be relative or
   ----------           absolute).

   
    LFNRmDir 
   

   Declaration:
   ---   procedure LFNRmDir (OldDir:string);   ---

   Removes the directory with the specified long name.

   Parameters: OldDir - the path of the directory to be removed (relative or
   ----------           absolute).

   
    LFNChDir 
   

   Declaration:
   ---   procedure LFNChDir (Dir:string);   ---

   Changes the current directory.

   Parameters: Dir - the path of the new current directory (absolute or
   ----------        relative to the current directory).

   
    LFNErase 
   

   Declaration:
   ---   procedure LFNErase (FileName:string;      ---
                             MustAttrs:byte;
                             SearchAttrs:byte;
                             Wildcards:boolean);

   Erases one or more files. If Wildcards is false (=NO_WILDCARDS) then only
   one file is erased (FileName), otherwise all the files matching the mask
   in FileName and the specified Attributes are erased.

   Parameters: FileName - the name or mask of the file(s) to be erased.
   ----------  MustAttrs - must match attributes of the file(s) to be erased.
               SearchAttrs - search attributes (see section 1.3).
               Wildcards - specifies whether wildcards are allowed.

   
    LFNGetAttrib 
   

   Declaration:
   ---   function LFNGetAttrib (FileName:string):word;   ---

   Retrieves the attributes of the specified file or directory.

   Parameters: FileName - the name of the file or directory to retrieve
   ----------             attributes for.

   Returns: the attributes of the specified file. You can find whether a
   -------  file has a specific attribute by masking the returned value with
            a FA_ constant (for example:
               (LFNGetAttrib ('x.pas') and FA_RDONLY)
            is true if the file is read-only. See section 4.2 for
            attribute constants.

   
    LFNSetAttrib 
   

   Declaration:
   ---   procedure LFNSetAttrib (FileName:string;    ---
                                 Attributes:word);

   Changes the attributes of the specified file or directory.

   Parameters: FileName - the name of the file or directory to change
   ----------             attributes of
               Attributes - the new attributes of the file.  See section
                            4.2 for attribute constants.

   
    LFNPhysicalFileSize 
   

   Declaration:
   ---   function LFNPhysicalFileSize (FileName:string):longint;   ---

   Retrieves the disk space allocated for a file (compressed or not). See
   'GetCompressedFileSize' for more details.

   Parameters: FileName - the long name of the file to retrieve information
   ----------             about.

   Returns: the space allocated for 'FileName' on the volume it is located
   -------  on.

   
    LFNGetModifTime 
   

   Declaration:
   ---   procedure LFNGetModifTime (FileName:string;       ---
                                    var DT:NewDateTime);

   Retrieves the date and time the file was last modified on.

   Parameters: FileName - the name of the file to retrieve information about
   ----------  DT - a NewDateTime structure receiving the information. See
                    section 4.2 for details.

   
    LFNSetModifTime 
   

   Declaration:
   ---   procedure LFNSetModifTime (FileName:string;   ---
                                    DT:NewDateTime);

   Sets the date and time the file was last modified on. This is
   automatically done by Windows 95 whenever an application opens a file for
   write.

   Parameters: FileName - the name of the file to set the modification time
   ----------             for.
               DT - a NewDateTime structure containing the new date and
                    time. See section 4.2 for details.

   
    LFNGetAccessTime 
   

   Declaration:
   ---   procedure LFNGetAccessTime (FileName:string;        ---
                                     var DT:NewDateTime);

   Retrieves the date and time the file was last accessed on.

   Parameters: FileName - the name of the file to retrieve information about
   ----------  DT - a NewDateTime structure receiving the information. See
                    section 4.2 for details.

   
    LFNSetAccessTime 
   

   Declaration:
   ---   procedure LFNSetAccessTime (FileName:string;   ---
                                     DT:NewDateTime);

   Sets the date the file was last accessed on. This is automatically
   done by Windows 95 whenever an application opens a file for write.

   Parameters: FileName - the name of the file to set the last accessed date
   ----------             for.
               DT - a NewDateTime structure containing the new date and
                    time. See section 4.2 for details.

   
    LFNGetCreateTime 
   

   Declaration:
   ---   procedure LFNGetCreateTime (FileName:string;        ---
                                     var DT:NewDateTime);

   Retrieves the date and time the file was created on.

   Parameters: FileName - the name of the file to retrieve information about
   ----------  DT - a NewDateTime structure receiving the information. See
                    section 4.2 for details.

   
    LFNSetCreateTime 
   

   Declaration:
   ---   procedure LFNSetCreateTime (FileName:string;   ---
                                     DT:NewDateTime);

   Sets the date and time the file was created.

   Parameters: FileName - the name of the file to set he creation date for.
   ----------  DT - a NewDateTime structure containing the new date and
                    time. See section 4.2 for details.

   
    LFNHGetModifTime 
   

   Declaration:
   ---   procedure LFNHGetModifTime (Handle:word;           ---
                                     var DT:NewDateTime);

   Retrieves the date and time the file was last modified on.

   Parameters: Handle - the handle of an open file.
   ----------  DT - a NewDateTime structure receiving the information. See
                    section 4.2 for details.

   
    LFNHSetModifTime 
   

   Declaration:
   ---   procedure LFNHSetModifTime (Handle:word;       ---
                                     DT:NewDateTime);

   Sets the date and time the file was last modified on. This is
   automatically done by Windows 95 whenever an application opens a file for
   write.

   Parameters: Handle - the handle of an open file.
   ----------  DT - a NewDateTime structure containing the new date and
                    time. See section 4.2 for details.

   
    LFNHGetAccessTime 
   

   Declaration:
   ---   procedure LFNHGetAccessTime (Handle:word;           ---
                                      var DT:NewDateTime);

   Retrieves the date and time the file was last accessed on.

   Parameters: Handle - the handle of an open file.
   ----------  DT - a NewDateTime structure receiving the information. See
                    section 4.2 for details.

   
    LFNHSetAccessTime 
   

   Declaration:
   ---   procedure LFNHSetAccessTime (Handle:word;       ---
                                      DT:NewDateTime);

   Sets the date the file was last accessed on. This is automatically
   done by Windows 95 whenever an application opens a file for write.

   Parameters: Handle - the handle of an open file.
   ----------  DT - a NewDateTime structure containing the new date and
                    time. See section 4.2 for details.

   
    LFNHGetCreateTime 
   

   Declaration:
   ---   procedure LFNHGetCreateTime (Handle:word;           ---
                                      var DT:NewDateTime);

   Retrieves the date and time the file was created on.

   Parameters: Handle - the handle of an open file.
   ----------  DT - a NewDateTime structure receiving the information. See
                    section 4.2 for details.

   
    LFNHSetCreateTime 
   

   Declaration:
   ---   procedure LFNSetCreateTime (Handle:word;       ---
                                     DT:NewDateTime);

   Sets the date and time the file was created.

   Parameters: Handle - the handle of an open file.
   ----------  DT - a NewDateTime structure containing the new date and
                    time. See section 4.2 for details.

   
    LFNGetDir 
   

   Declaration:
   ---   function LFNGetDir (Drive:byte):string;   ---

   Retrieves the current directory on the specified drive (0 = default).

   Parameters: Drive - 0 for default, 1 for A, 2 for B, etc.
   ----------

   Returns: the current directory on Drive.
   -------

   
    LFNFindFirst 
   

   Declaration:
   ---   function LFNFindFirst (FileName:string;                ---
                                MustAttrs:byte;
                                SearchAttrs:byte;
                                var FindData:TFindData):byte;

   Searches a directory for the first file or directory whose name and
   attributes match the specified ones. If no wildcards (? or *) are
   specified there is no need to call LFNFindNext, because there will not be
   more than one file matching the name and attributes.

   Parameters: FileName - the file or directory or file mask to search for.
   ----------  MustAttrs - must match attributes
               SearchAttrs - search attributes. For more details on
                             attributes see section 1.3.
               FindData - a TFindData structure receiving the information
                          about the found file (see section 4.2 for details).

   Returns: a search handle that can be used in subsequent calls of
   -------  LFNFindNext and must be used in LFNFindClose.

   
    LFNFindNext 
   

   Declaration:
   ---   procedure LFNFindNext (Handle:word;               ---
                                var FindData:TFindData);

   Searches for the next file or directory matching the search criteria
   specified in the LFNFindFirst function.

   Parameters: Handle - the search handle (returned by LFNFindFirst).
   ----------  FindData - a TFindData structure receiving the information
                          about the found file (see section 4.2 for details).

   
    LFNFindClose 
   

   Declaration:
   ---   procedure LFNFindClose (Handle:word);   ---

   Closes a search handle.

   Parameters: Handle - the search handle (return by LFNFindFirst).
   ----------

   
    LFNRename 
   

   Declaration:
   ---   procedure LFNRename (OldName:string;        ---
                              NewName:string);

   Renames a file.

   Parameters: OldName - the old name of the file.
   ----------  NewName - the new name of the file.

   
    GetFullPathName 
   

   Declaration:
   ---   function GetFullPathName (SourcePath:string;             ---
                                   SubstExpand:boolean):string;

   Retrieves the full path of a file, directory or path.

   Parameters: SourcePath - a file, directory or path to retrieve the full
   ----------               path for. Either the LFN or the standard 8.3
                            format is accepted.
               SubstExpand - specifies whether the returned path should
                             contain a SUBST drive letter or the path
                             associated with the SUBST drive. See section 4.2
                             for details.

   Returns: the full path.
   -------

   
    GetShortPathName 
   

   Declaration:
   ---   function GetShortPathName (SourcePath:string;             ---
                                    SubstExpand:boolean):string;

   Retrieves the full path of a file, directory or path in its short (8.3)
   form.

   Parameters: SourcePath - a file, directory or path to retrieve the
   ----------               short path for. Either LFN or 8.3 format is
                            accepted.
               SubstExpand - specifies whether the returned path should
                             contain a SUBST drive letter or the path
                             associated with the SUBST drive. See section 4.2
                             for details.

   Returns: the full path in the 8.3 form.
   -------

   
    GetLongPathName 
   

   Retrieves the full path of a file, directory or path in its long (LFN)
   form.

   Parameters: SourcePath - a file, directory or path to retrieve the long
   ----------               path for. Either LFN or 8.3 format is accepted.
               SubstExpand - specifies whether the returned path should
                             contain a SUBST drive letter or the path
                             associated with the SUBST drive. See section 4.2
                             for details.

   Returns: the full path in the long form.
   -------

   
    LFNOpenFile 
   

   Declaration:
   ---   function LFNOpenFile (FileName:string;        ---
                               Attributes:word;
                               Flags:word;
                               AliasHint:word):word;

   Opens an existing file for read or write. This function fails if the file
   does not exist and OPEN_AUTOCREATE flag is not used.

   Parameters: FileName - file to open. The file name may be in either LFN
   ----------             or the 8.3 format.
               Attributes - attributes of the new file (if OPEN_AUTOCREATE).
               Flags - see section 4.2.
               AliasHint - the number to add to the short name associated
                           by Windows with the long name specified. If you
                           want to override the default numbering scheme, you
                           have to specify the OPEN_FLAGS_ALIAS_HINT in
                           addition to specifying this parameter.

   Returns: a handle to the opened file. The handle is a 16-bit value and is
   -------  used in read, write, seek, close, file date and attributes
            management LFN functions.

   
    LFNCreateFile 
   

   Declaration:
   ---   function LFNCreateFile (FileName:string;        ---
                                 Attributes:word;
                                 Flags:word;
                                 AliasHint:word):word;

   Creates a file and opens it for read/write. This function fails if the
   file already exists.

   Parameters: FileName - file to create. The file name may be in either LFN
   ----------             or the 8.3 format.
               Attributes - attributes of the new file.
               Flags - see section 4.2.
               AliasHint - the number to add to the short name associated
                           by Windows with the long name specified. If you
                           want to override the default numbering scheme, you
                           have to specify the OPEN_FLAGS_ALIAS_HINT in
                           addition to specifying this parameter.

   Returns: a handle to the created file. The handle is a 16-bit value and
   -------  is used in read, write, seek, close, file date and attributes
            management LFN functions.

   
    LFNTruncateFile 
   

   Declaration:
   ---   function LFNTruncFile (FileName:string;        ---
                                Attributes:word;
                                Flags:word;
                                AliasHint:word):word;

   Opens a file and truncates it to zero length (replaces the file). This
   function fails if the file does not exist and OPEN_AUTOCREATE is not used.

   Parameters: FileName - file to truncate. The file name may be in either
   ----------             LFN or the 8.3 format.
               Attributes - attributes of the new file.
               Flags - see section 4.2.
               AliasHint - the number to add to the short name associated
                           by Windows with the long name specified. If you
                           want to override the default numbering scheme, you
                           have to specify the OPEN_FLAGS_ALIAS_HINT in
                           addition to specifying this parameter.

   Returns: a handle to the truncated file. The handle is a 16-bit value and
   -------  is used in read, write, seek, close, file date and attributes
            management LFN functions.

   
    LFNRewrite 
   

   Declaration:
   ---   function LFNRewrite (FileName:string):word;   ---

   Opens a file for write only. Truncates the file if it already exists and
   creates it if it does not exist.

   See LFNTruncFile and section 1.1 for more details.

   
    LFNReset 
   

   Declaration:
   ---   function LFNReset (FileName:string):word;   ---

   Opens a file for read only. Fails if the file does not exist.

   See LFNOpenFile and section 1.1 for more details.

   
    LFNAppend 
   

   Declaration:
   ---   function LFNAppend (FileName:string):word;   ---

   Opens a file for write only. Fails if the file does not exist; moves the
   file pointer to the end of the file otherwise.

   See LFNOpenFile and section 1.1 for more details.

   
    LFNBlockRead 
   

   Declaration:
   ---   function LFNBlockRead (Handle:word;       ---
                                var Buffer;
                                Size:word):word;

   Reads data from a file.

   Parameters: Handle - the file handle (returned by LFN***File or
   ----------           Ext***File).
               Buffer - a buffer for the read data (an array of bytes, for
                        example).
               Size - the number of bytes to read.

   Returns: the number of bytes actually read.
   -------

   
    LFNBlockWrite 
   

   Declaration:
   ---   function LFNBlockWrite (Handle:word;       ---
                                 var Buffer;
                                 Size:word):word;

   Writes data to a file.

   Parameters: Handle - the file handle (returned by LFN***File or
   ----------           Ext***File).
               Buffer - a buffer containing the data to write (an array of
                        bytes, for example).
               Size - the number of bytes to write.

   Returns: the number of bytes actually written.
   -------

   
    LFNSeek 
   

   Declaration:
   ---   function LFNSeek (Handle:word;               ---
                           Origin:byte;
                           Offset:longint):longint;

   Moves the file pointer to a new position. For origins SEEK_CUR and
   SEEK_END the pointer may be positioned before the start of the file; no
   error is returned in this case, but subsequent read and write operations
   will fail. If the new position is after the current end of the file, the
   file will be extended by the next write.

   Parameters: Handle - the file handle (returned by LFN***File or
   ----------           Ext***File).
               Origin - the origin for the offset. See section 4.2 for
                        details.
               Offset - the number of bytes to move relative to origin.
                        May be positive (move forward) or negative (move
                        backward).

   Returns: the new file position.

   
    LFNCloseFile 
   

   Declaration:
   ---   procedure LFNCloseFile (Handle:word);   ---

   Closes a file.

   Parameters: Handle - the file handle.
   ----------

   
    GetVolumeInformation 
   

   Declaration:
   ---   procedure GetVolumeInformation (RootName:string;         ---
                                         var VolInfo:TVolInfo);

   Retrieves information about the volume associated with the given root
   directory.

   Parameters: RootName - the name of the root directory of the volume to
   ----------             check (in 'C:\' format).
               VolInfo - a TVolInfo structure receiving the information about
                         the file system. See section 4.2 for details.

   
    LFNGenShortName 
   

   Declaration:
   ---   function LFNGenShortName (LFN:string;             ---
                                   CharSet:byte):string;

   Generates a short name in the 8.3 format for the specified long name. The
   generated short name will not never have a numeric tail, because this
   function does not check the current directory to see if the short name
   already exists. A numeric tail consists of the tilde character (~)
   followed by a number.

   Parameters: LFN - a long file name (up to 255 characters). This must be
   ----------        a file name, not a path.
               CharSet - the character set to use for the long file name. See
                         section 4.2 for details.

   Returns: the generated short name.
   -------

   
    CreateSubst 
   

   Declaration:
   ---   procedure CreateSubst (Drive:byte;     ---
                                Path:string);

   Associates a path with a drive letter.

   Parameters: Drive - drive to SUBST (0 = default, 1 = A, 2 = B, etc.).
   ----------  Path - the path to associate with the drive letter.

   
    TerminateSubst 
   

   Declaration:
   ---   procedure TerminateSubst (Drive:byte);   ---

   Terminates the association between a path and a drive letter.

   Parameters: Drive - the drive SUBSTituted. Can be 1 for A, 2 for B, and
   ----------          so on, but not 0 for default.

   
    GetSubst 
   

   Declaration:
   ---    function GetSubst (Drive:byte):string;   ---

   Retrieves the path associated with a drive letter.

   Parameters: Drive - the drive SUBSTituted (1 = A, 2 = B, etc.). Can not
   ----------          be 0 = default.

   Returns: the path associated with the specified drive.
   -------

4.2. Constants, Variables and Types.
-----------------------------------

   
    VARIABLES 
   

      DOS7Error: word;

   The DOS7Error variable is changed whenever a function included in this
unit is called. It is 0 if no error occured and <>0 if there is an error.
Here are the possible values for DOS7Error:

 Value     Meaning
-------------------------------------------------------------------------
 00h (0)   no error
 01h (1)   function number invalid
 02h (2)   file not found
 03h (3)   path not found
 04h (4)   too many open files (no handles available)
 05h (5)   access denied
 06h (6)   invalid handle
 07h (7)   memory control block destroyed
 08h (8)   insufficient memory
 09h (9)   memory block address invalid
 0Ah (10)  environment invalid (usually >32K in length)
 0Bh (11)  format invalid
 0Ch (12)  access code invalid
 0Dh (13)  data invalid
 0Eh (14)  reserved
 0Fh (15)  invalid drive
 10h (16)  attempted to remove current directory
 11h (17)  not same device
 12h (18)  no more files
 13h (19)  disk write-protected
 14h (20)  unknown unit
 15h (21)  drive not ready
 16h (22)  unknown command
 17h (23)  data error (CRC)
 18h (24)  bad request structure length
 19h (25)  seek error
 1Ah (26)  unknown media type (non-DOS disk)
 1Bh (27)  sector not found
 1Ch (28)  printer out of paper
 1Dh (29)  write fault
 1Eh (30)  read fault
 1Fh (31)  general failure
 20h (32)  sharing violation
 21h (33)  lock violation
 22h (34)  disk change invalid (ES:DI -> media ID structure)(see #1021)
 23h (35)  FCB unavailable
 24h (36)  sharing buffer overflow
 25h (37)  code page mismatch
 26h (38)  cannot complete file operation (out of input)
 27h (39)  insufficient disk space
 28h-31h   reserved
 32h (50)  network request not supported
 33h (51)  remote computer not listening
 34h (52)  duplicate name on network
 35h (53)  network name not found
 36h (54)  network busy
 37h (55)  network device no longer exists
 38h (56)  network BIOS command limit exceeded
 39h (57)  network adapter hardware error
 3Ah (58)  incorrect response from network
 3Bh (59)  unexpected network error
 3Ch (60)  incompatible remote adapter
 3Dh (61)  print queue full
 3Eh (62)  queue not full
 3Fh (63)  not enough space to print file
 40h (64)  network name was deleted
 41h (65)  network: Access denied
 42h (66)  network device type incorrect
 43h (67)  network name not found
 44h (68)  network name limit exceeded
 45h (69)  network BIOS session limit exceeded
 46h (70)  temporarily paused
 47h (71)  network request not accepted
 48h (72)  network print/disk redirection paused
 49h (73)  network software not installed
 4Ah (74)  unexpected adapter close
 4Fh (79)  reserved
 50h (80)  file exists
 51h (81)  reserved
 52h (82)  cannot make directory
 53h (83)  fail on INT 24h
 54h (84)  too many redirections
 55h (85)  duplicate redirection
 56h (86)  invalid password
 57h (87)  invalid parameter
 58h (88)  network write fault
 59h (89)  function not supported on network
 5Ah (90)  required system component not installed
 64h (100) (MSCDEX) unknown error
 65h (101) (MSCDEX) not ready
 66h (102) (MSCDEX) EMS memory no longer valid
 67h (103) (MSCDEX) not High Sierra or ISO-9660 format
 68h (104) (MSCDEX) door open
 B0h (176) volume is not locked
 B1h (177) volume is locked in drive
 B2h (178) volume is not removable
 B4h (180) lock count has been exceeded
 B5h (181) a valid eject request failed
 FFh (255) unknown error
-------------------------------------------------------------------------

   
    CONSTANTS 
   

      Drive map info flags.
      

      The Flags member of the TMapInfo structure can be a combination of the
      following values:

      DMI_PM_LOGICAL_DRIVE=$0001;
         A protected-mode driver is in use for this logical drive.
      DMI_PM_PHYSICAL_DRIVE=$0002;
         A protected-mode driver is in use for the physical drive containing
         this logical drive.
      DMI_PM_ONLY_DRIVE=$0004;
         This drive is not available when running MS-DOS.
      DMI_PM_EJECT=$0008;
         The drive supports an eject operation.
      DMI_PM_ASYNC_NOTIFY=$0010;
         The drive issues media arrival and removal notifications (this value
         is currently used for CD-ROM drives - the AutoMount feature).

      Query close flags.
      

      The QueryClose function returns one of the following values:

      CL_NOTACK=0;
         The close command was chosen, and the application has not
         acknowledged the close state.
      CL_ACK=1;
         The close command was chosen and the application has acknowledged
         the close state.
      CL_NOT=2;
         The close command has not been chosen or the application has not
         enabled the Close command.

      File attributes.
      

      The file attributes can be a combination of the following values:

      FA_NORMAL=$0000;
         The file can be read from and can be written to. This value is
         valid only if used alone.
      FA_RDONLY=$0001;
         The file is read-only; it can not be written to.
      FA_HIDDEN=$0002;
         The file is hidden; it does not appear in an ordinary directory
         listing.
      FA_SYSTEM=$0004;
         The file is a part of the operating system.
      FA_VOLUME=$0008;
         The name specified by FileName is the volume label of the current
         drive.
      FA_DIR=$0010;
         The name specified by FileName is a directory.
      FA_ARC=$0020;
         The file is an archive file.
      FA_ANY=$003F;
         Used to specify any file.
      FA_TEMP=$0100;
         A temporary file.

      Open constants.
      

      The Flags parameter of the Ext***File or LFN***File functions can be
      one value each from the access and sharing modes and any combination
      of open flags:

      Access Mode:

      OPEN_RDONLY=$0000;
         Open the file for reading only.
      OPEN_WRONLY=$0001;
         Open the file for writing only.
      OPEN_RDWR=$0002;
         Open the file for reading and writing.
      OPEN_RO_NOMOD=$0004;
         Open the file for reading only without modifying the last access
         date.

      Sharing Mode:

      OPEN_SHARE_COMPATIBLE=$0000;
         Open the file with compatibility mode, allowing it to be opened any
         number of times.
      OPEN_SHARE_DENYREADWRITE=$0010;
         Open the file and deny both read and write access for other
         processes.
      OPEN_SHARE_DENYWRITE=$0020;
         Open the file and deny write access for other processes.
      OPEN_SHARE_DENYREAD=$0030;
         Open the file and deny read access for other processes.
      OPEN_SHARE_DENYNONE=$0040;
         Open the file without denying read or write acces for other
         processes, but the file can not be opened with compatibility mode
         by any process.

      Open Flags:

      OPEN_AUTOCREATE=$0008;
         In LFNOpenFile and LFNTruncFile, it is used to specify that the file
         should be created in case it does not exist.
      OPEN_FLAGS_NOINHERIT=$0080;
         If this flag is set, child processes (created with Exec) do not
         inherit the file handle.
      OPEN_FLAGS_NOBUFFERING=$0100;
         The file is to be opened with no intermediate buffering or caching.
         All reads and writes to the file must be done at positions that are
         multiples of the disk sector size, and the number of bytes read or
         written must also be a multiple of the disk sector size.
      OPEN_FLAGS_NOCOMPRESS=$0200;
         The file should not be compressed on a compressed volume. If the
         volume does not support compression, this flag is not used.
      OPEN_FLAGS_ALIAS_HINT=$0400;
         The value in AliasHint is used. (See LFN***File for details).
      OPEN_FLAGS_NOCRITERR=$2000;
         If a critical error occurs while DOS is opening the file, Int 24h
         is not called. Instead, DOS returns an error value to the program.
      OPEN_FLAGS_COMMIT=$4000;
         After each write operation, DOS flushes the cache buffer.

      Seek constants.
      

      These are constants for the origin of seek.

      SEEK_BEG=0;
         The origin for Offset parameter in the LFNSeek command is the
         beginning of the file.
      SEEK_CUR=1;
         The origin for Offset parameter in the LFNSeek command is the
         current position of the file pointer.
      SEEK_END=2;
         The origin for Offset parameter in the LFNSeek command is the
         end of the file.

      Volume information flags.
      

      The Flags member of the TVolInfo structure is a combination of the
      following values:

      FS_CASE_SENSITIVE=$0001;
         Specifies that searches in this volume are case-sensitive.
      FS_CASE_PRESERVED=$0002;
         Case is preserved in directory entries.
      FS_UNICODE_USED=$0004;
         Unicode character can be used in file and directory names.
      FS_LFN_APIS=$4000;
         Supports new LFN functions.
      FS_COMPRESSED=$8000;
         Specifies that the volume is compressed.

      Character sets.
      

      The following character sets can be used in the LFNGenShortName
      function:

      CS_WANSI=0;
         Windows ANSI character set.
      CS_OEM=1;
         Current OEM character set.
      CS_UNICODE=2;
         Unicode character set.

      SUBST Expand.
      

      The SubstExpand parameter in Get***PathName can be:

      NO_SUBST_EXPAND=False;
         In this case the path returned by the Get***PathName functions
         contains the path associated with the SUBST drive.
      SUBST_EXPAND=True;
         In this case the path returned by the Get***PathName functions
         contains the SUBST drive letter.

      Erase Wildcards.
      

      The Wildcards parameter in LFNErase can be:

      NO_WILDCARDS=False;
         Wildcards can not be used in the FileName parameter of the LFNErase
         function; maximum one file will be deleted. Any specified attributes
         will be ignored.
      WILDCARDS=True;
         Wildcards are allowed; many files can be deleted. Specified file
         attributes are matched.

      Swap File Pager Type.
      

      The Pager member of the TSwapInfo record can be:

      SW_NOPAGER=1;
         There is no pager.
      SW_DOSPAGER=2;
         Paging through MS-DOS.
      SW_IOSPAGER=3;
         Paging through the protected-mode I/O supervisor.

   
    TYPES 
   

   LFNFile=word;
      A file in the DOS70 unit is just a 16-bit unsigned integer.

   TMapInfo=record { structure used in GetDriveMapInfo }
      Flags:byte; { see CONSTANTS }
      Int13Unit:byte; { the physical drive number :
                        $00-$7F for floppy disk drives (00=first, 01=second)
                        $80-$FE for HDDs ($80=first, $81=second)
                        $FF if the drive does not map to a physical drive. }
      AssociatedDriveMap:comp; { Logical drive numbers associated with the
                                 given physical drive. For example, a host
                                 drive C with child drive letters D and E
                                 would have bits 4 and 5 set }
      PartitionStartRBA:comp; { The relative block offset from the start of
                                the physical volume to the start of the
                                given partition }
   end;

   TVolInfo=record { structure used in GetVolumeInformation }
      FSName:string; { the name of the file system:
                       FAT = 12 or 16-bit fat (on floppy disks or hard disks)
                       FAT32 = 32-bit fat (in Windows 95 OSR 2 with DOS 7.1)
                       CDFS = CD file system
                       NTFS = Windows NT file system }
      Flags:word; { see CONSTANTS }
      MaxFileName:word; { the maximum length of a file name. This is 255 for
                          FAT and FAT32 systems }
      MaxPathName:word; { the maximum length of a path. This is 260 for FAT
                          and FAT32 systems }
   end;

   NewDateTime=record { a DateTime structure containing the milliseconds }
      Year:word; { the year }
      Month:byte; { the month }
      Day:byte; { the day }
      Hour:byte: { hours }
      Minute:byte; { minutes }
      Second:byte; { seconds }
      Millisecond:word; { milliseconds }
   end;

   TFindData=record { used in FindFirst/Next }
      Name:string; { the name of the found file }
      ShortName:string; { the short name (in 8.3 format) of the found file }
      Size:comp; { the size of the file }
      Attrs:word; { the attributes of the file }
      TimeModified:NewDateTime; { when was the file last modified ? }
      TimeAccessed:NewDateTime; { when was the file last accessed ? }
      TimeCreated:NewDateTime; { when was the file created ? }
   end;

   TSwapInfo=record { used in GetSwapFileInfo }
      FileName; { the name of the swap file }
      FileSize; { the size of the swap file, in bytes }
      Pager; { see CONSTANTS }
   end;

--- END OF MANUAL.TXT ---