API Reference > OdRx Classes > OdRxSystemServices Class > OdRxSystemServices Methods > OdRxSystemServices::createFile Method
OdRxSystemServices::createFile Method
Syntax
C++
virtual OdStreamBufPtr createFile(const OdString& filename, Oda::FileAccessMode accessMode = Oda::kFileRead, Oda::FileShareMode shareMode = Oda::kShareDenyNo, Oda::FileCreationDisposition creationDisposition = Oda::kOpenExisting);
Parameters 
Description 
const OdString& filename 
[in] Filename.  
Oda::FileAccessMode accessMode = Oda::kFileRead 
[in] Access mode.  
Oda::FileShareMode shareMode = Oda::kShareDenyNo 
[in] Share mode.  
Oda::FileCreationDisposition creationDisposition = Oda::kOpenExisting 
[in] Creation disposition. 

Returns a SmartPointer to an OdStreamBuf object for the file.

Creates and/or opens the specified file.

accessMode must be a combination of one or more of the following: 

 

Name 
Value 
Description 
Oda::kFileRead 
0x80000000 
Read access. 
Oda::kFileWrite 
0x40000000 
Write access. 

 

shareMode must be one of the following: 

 

Name 
Value 
Description 
Oda::kShareDenyReadWrite 
0x10 
deny read/write mode 
Oda::kShareDenyWrite 
0x20 
deny write mode 
Oda::kShareDenyRead 
0x30 
deny read mode 
Oda::kShareDenyNo 
0x40 
deny none mode 

 

Creation disposition must be one of the following: 

 

Name 
Value 
Description 
Oda::kCreateNew 
Creates a new file; fails if the specified file already exists. 
Oda::kCreateAlways 
Creates a new file; overwrites any existing file. 
Oda::kOpenExisting 
Opens the file; fails if the file does not exist. 
Oda::kOpenAlways 
Opens the file; creates the file if it does not exist. 
Oda::kTruncateExisting 
Truncates the file; fails if the file does not exist. The file must be open at least Oda::kFileWrite. 
Copyright © 2002–2020. Open Design Alliance. All rights reserved.