company logo

FileHandle :: OpenCreatePath - Open file handle

The file handle is opened at the location cpath in the given access mode and as binary file, always.. If the file is opened in write mode (PI_Write) existing file will be overwritten. If the file path passed in cpath does not exist, the file will be created.

// C++

file_handle.OpenCreatePath("myFile.txt",PI_Write);

// OSI

file_handle.OpenCreatePath("myFile.txt","PI_Write");

file_handle.OpenCreatePath("myFile.txt",PIACC::PI_Write);

Notes:

The access mode has to be passed as enumerator value in C++. In OSI, the value might be passed as scoped enumerator value or as string containing the enumerator name.

Return value:  Success ( logical  )

Implementation details

logical FileHandle  :: OpenCreatePath ( NPath &cpath, PIACC accopt )
  • cpath - Complete file or directory path
  • accopt - Access mode