Internal function used by its front-ends : cls(), crm(), cdu(), cwc()
List the content of CliMAF cache according to some search criteria and operate possibly an action (usage, count or remove) on this list.
Please consider the cost and benefit of first updating CliMAF cache index (by scanning files on disk) using csync()
Parameters: |
|
---|---|
Returns: |
|
Remove the cache files found by ‘clist()’ when using same arguments. See clist()
Example to remove files using more than 3M of disk space, which status was last changed more than 15 days ago and containing the pattern ‘1980-1981’ either in crs or filename:
>>> crm(size='3M', age='+15', pattern='1980-1981')
Report disk usage, for files matching some criteria, as specified for clist(). With count=True, report only total disk usage.
Example to search files using more than 3M of disk space, which status was last changed more than 15 days ago and containing the pattern ‘1980-1981’ either in crs or filename. For found files, we want to estimate only found files total space usage:
>>> cdu(size='3M', age='+15', pattern= '1980-1981', count=True)
Report number of cache files matching some criteria, as specified for clist(). If CRS is True, also return CRS expression of found files.
Example to return the number and crs associated of files using more than 3M of disk space, which status was last changed more than 15 days ago and containing the pattern ‘1980-1981’ either in crs or filename:
>>> cwc(size='3M', age='+15', pattern= '1980-1981', CRS=True)
Clear CliMAF cache : erase existing files content, reset in-memory index
Parameters: | hideError (bool) – if True, will not warn for non existing cache |
---|
Deletes the cached file for a CliMAF object, if it exists
Parameters: |
|
---|---|
Returns: | None if object does not exists, False if failing to delete, True if OK |
Example
>>> dg=ds(project='example', simulation='AMIPV6ALB2G', variable='tas', period='1980-1981')
>>> f=cfile(dg)
>>> os.system('ls -al '+f)
>>> cdrop(dg)