The amount of concurrently open files above which files containing data arrays may be automatically closed.
The amount is 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
>>> old = cf.OF_FRACTION(0.33)
>>> cf.OF_FRACTION(old)
0.33
>>> cf.OF_FRACTION()
0.5
The fraction may be translated to an actual number of files as follows:
>>> old = cf.OF_FRACTION(0.75)
>>> import resource
>>> max_open_files = resource.getrlimit(resource.RLIMIT_NOFILE)[0]
>>> threshold = int(max_open_files * cf.OF_FRACTION())
>>> max_open_files, threshold
(1024, 768)