Return or set the number of concurrently open files above which files containing data arrays may be automatically closed.
Expressed as a fraction of the maximum possible number of concurrently open files.
Note that closed files will be automatically reopened if subsequently needed by a variable to access its data array.
Parameters : |
|
---|---|
Returns : |
|
Examples
>>> cf.OF_FRACTION()
0.5
>>> cf.OF_FRACTION(0.75)
>>> cf.OF_FRACTION()
0.75
The fraction may be translated to an actual number of files as follows:
>>> import resource
>>> max_open_files = resource.getrlimit(resource.RLIMIT_NOFILE)[0]
>>> threshold = int(cf.OF_FRACTION() * max_open_files)
>>> max_open_files, threshold
(1024, 768)