theBuffer-&gt;TVS_doc.DI_docName, 
           FILE_LONGNAME_BUFFER_SIZE );

  /* Open the document file. */
  FilePushDir();
  FoamSetDocumentDir( theBuffer-&gt;TVS_doc.DI_docDir );
  pself-&gt;MVDI_fileStash = VMOpen( theBuffer-&gt;TVS_doc.DI_docName,
                                  VMAF_FORCE_READ_WRITE | VMAF_FORCE_DENY_WRITE, 
                                  VMO_OPEN, 0 );

  if ( NullHandle == pself-&gt;MVDI_fileStash ) {
    /* Something went wrong when we attempted to open the file.
       In the