Main Content

cdflib.setCacheSize

Specify number of CDF cache buffers

Syntax

cdflib.setCacheSize(cdfId,numBuffers)

Description

cdflib.setCacheSize(cdfId,numBuffers) specifies the number of cache buffers the CDF library uses for an open CDF file.

cdfId identifies an open CDF file. numBuffers is a numeric value that specifies the number of buffers.

For information about cache schemes, see the CDF User's Guide on NASA's Space Physics Data Facility website.

Examples

collapse all

Create a new CDF file and check its cache size.

cdfId = cdflib.create("my_file.cdf");
defaultCacheSize = cdflib.getCacheSize(cdfId)
defaultCacheSize = 
300

Specify a smaller cache size for the file. Then check that the file reflects the intended change.

newCacheSize = 150;
cdflib.setCacheSize(cdfId,newCacheSize)
updatedCacheSize = cdflib.getCacheSize(cdfId)
updatedCacheSize = 
150

Remove the CDF file and the cdfId variable.

cdflib.delete(cdfId)
clear cdfId

Tips

  • This function corresponds to the CDF library C API routine CDFsetCacheSize.

  • To use this function, you must be familiar with the CDF C interface. You can access the CDF documentation at the CDF website.