Opens a file for binary input/output.


#include "petscviewer.h"   
PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char name[],PetscFileMode mode,PetscViewer *viewer)

Input Parameters

comm - MPI communicator
name - name of file
mode - open mode of file
   FILE_MODE_WRITE - create new file for binary output
   FILE_MODE_READ - open existing file for binary input
   FILE_MODE_APPEND - open existing file for binary output

Output Parameter

viewer - PetscViewer for binary input/output to use with the specified file

Options Database Keys

-viewer_binary_filename <name> -
-viewer_binary_skip_info -
-viewer_binary_skip_options -
-viewer_binary_skip_header -
-viewer_binary_mpiio -

Level: beginner


This PetscViewer should be destroyed with PetscViewerDestroy().

For reading files, the filename may begin with ftp:// or http:// and/or end with .gz; in this case file is brought over and uncompressed.

For creating files, if the file name ends with .gz it is automatically compressed when closed.

See Also

PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(),
VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryGetUseMPIIO(), PetscViewerBinaryGetMPIIOOffset()