Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

cdflib.setReadOnlyMode

Specify read-only mode

Syntax

cdflib.setReadOnlyMode(cdfId,mode)

Description

cdflib.setReadOnlyMode(cdfId,mode) specifies the read-only mode of a Common Data Format (CDF) file.

After you open a CDF file, you can put the file into read-only mode to prevent accidental modification.

Input Arguments

cdfId

Identifier of a CDF file, returned by a call to cdflib.create or cdflib.open.

mode

Either of the following text strings or its numeric equivalent.

'READONLYon'CDF file is read-only
'READONLYoff'CDF file is modifiable.

To get the numeric equivalent of these mode values, use cdflib.getConstantValue.

Examples

Open the example CDF file and set the file to read-only mode.

cdfId = cdflib.open('example.cdf');

% Set the  file to READONLY mode
cdflib.setReadOnlyMode(cdfId,'READONLYon')

% Check read-only status of file again.
mode = cdflib.getReadOnlyMode(cdfId)

mode =

READONLYon

% Clean up
cdflib.close(cdfId)
clear cdfId

Related Examples

References

This function corresponds to the CDF library C API routine CDFsetReadOnlyMode.

To use this function, you must be familiar with the CDF C interface. Read the CDF documentation at the CDF website.

For copyright information, see the cdfcopyright.txt file.

Was this topic helpful?