Close

Relief for ODA Team in Ukraine

Learn more
ODA Kernel SDK
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);

Creates and/or opens the specified file.

Parameters
Description
filename
[in] Filename.
accessMode
[in] Access mode.
shareMode
[in] Share mode.
creationDisposition
[in] Creation disposition.

Returns a SmartPointer to an OdStreamBuf object for the 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
1
Creates a new file; fails if the specified file already exists.
Oda::kCreateAlways
2
Creates a new file; overwrites any existing file.
Oda::kOpenExisting
3
Opens the file; fails if the file does not exist.
Oda::kOpenAlways
4
Opens the file; creates the file if it does not exist.
Oda::kTruncateExisting
5
Truncates the file; fails if the file does not exist. The file must be open at least Oda::kFileWrite.
Copyright © 2002-2022. Open Design Alliance All rights reserved.