cdflib.setReadOnlyMode
Specify read-only mode
Syntax
cdflib.setReadOnlyMode(cdfId,
mode
)
Description
cdflib.setReadOnlyMode(cdfId,
specifies the read-only mode of a Common Data Format (CDF) file.mode
)
After you open a CDF file, you can put the file into read-only mode to prevent accidental modification.
Input Arguments
|
Identifier of a CDF file, returned by a call to | ||||
|
Mode value, specified as one of these character vectors or string scalars, or its numeric equivalent.
To get the numeric equivalent of these mode values, use |
Examples
Open the example CDF file and set the file to read-only mode.
cdfId = cdflib.create("your_file.cdf"); % Check the default READONLY mode mode = cdflib.getReadOnlyMode(cdfId)
mode = 'READONLYoff'
% Set the file to READONLY mode cdflib.setReadOnlyMode(cdfId,"READONLYon") % Check read-only status of file again mode = cdflib.getReadOnlyMode(cdfId)
mode = 'READONLYoff'
% Clean up cdflib.close(cdfId) clear cdfId
Tips
This function corresponds to the CDF library C API routine
CDFsetReadOnlyMode
.To use this function, you must be familiar with the CDF C interface. You can access the CDF documentation at the CDF website.