PWB Extensions Help (ext.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
FileNameToHandle
                                             Up Contents Index Back
─────PWB Extensions─────────────────────────────────────────────────────────
 
  Syntax:  PFILE FileNameToHandle( char far *FileName,
                                   char far *ShortName );
 
  Returns: The handle to the given file. Returns PNULL if the given file
           is not open in PWB.
 
  See:     DelFile, fChangeFile, FileRead, FileWrite,
           fSetWindowWithFile, GetPfileFromName, pFileToBottom,
           pFileToTop, RemoveFile, Using Files
 
     FileNameToHandle returns the handle of an open file.
 
     The <FileName> string contains the full name of a file. A drive
     and directory can be included. The <ShortName> string contains a
     short name consisting of the base name only. Either string can be
     an empty string or NULL to indicate that the parameter should be
     ignored.
 
     PWB first looks for an exact match of <FileName> in its list of
     open files. If the name is not found, and <ShortName> is not an
     empty string or NULL, PWB tries to find <ShortName> by searching
     for a matching base name in its internal list of files.
 
     If both parameters are empty strings or NULL, FileNameToHandle
     returns the handle of the current file.
 
     NOTE: PWB 1.x extensions often omit checking the return value of
           FileNameToHandle when getting the handle for the current
           file, since there is always a current file in PWB 1.x. In PWB
           2.00, it is possible to have no current file.
                                    -♦-