PWB Extensions Help (ext.hlp) (Table of Contents; Topic list)
AddFile
                                             Up Contents Index Back
─────PWB Extensions─────────────────────────────────────────────────────────
 
  Syntax:  PFILE AddFile( char far *FileName );
 
  Returns: A handle to the file.
 
  See:     DelFile, fChangeFile, FileNameToHandle, FileRead, FileWrite,
           fSetWindowWithFile, GetPfileFromName, pFileToBottom,
           pFileToTop, RemoveFile, Using Files
 
     AddFile opens a file specified by <FileName>. The file can be new
     or already existing on disk. However, it should not already be open
     for editing. Therefore, you should always check first to see
     whether the file is already open by calling FileNameToHandle.
 
     After opening a file, you must immediately call FileRead. If you
     open a new file buffer, the file will not actually exist on disk
     until you call FileWrite.
 
     To create a pseudofile, pass a pseudofile name. A pseudofile name
     has the form:
 
          <ShortName>Window Title
 
     The short form of the pseudofile name includes the angle brackets.
     The title part of the pseudofile name (the part after the closing
     angle bracket) is optional.
 
     You must call FileRead after calling Addfile. You can read the
     contents of a disk file into the pseudofile. In this case, make
     sure to reset the FAKE bit in the flags byte for the pseudofile.
     Use GetEditoObject and SetEditorObject with the RQ_ALLFILE_FLAGS
     request to modify the flag byte.
     See: GetEditorObject, Pseudofile Naming Convention
 
     AddFile never returns an error value. Certain out-of-memory
     conditions cause AddFile to fail, but in that case the function
     does not return. Instead, the PWB session is terminated.
                                    -♦-