RemoveFile_ByDiskUsage
Removes files sorted by size until disk usage drops below the specified threshold.
Syntax
C++
Python
def RemoveFile_ByDiskUsage( inDirectory: str, inMaxDiskUsage: float, inSortingOrder: SortingOrder, inMask: str, /, *, inMaskType: FileNameFilter = FileNameFilter.Wildcard, inRecursive: bool = False, inRemoveDirectories: bool = True ) -> ( outRemoved: list[str], outRemovedSize: int )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inDirectory | str | Directory from which the files will be deleted | ||
![]() |
inMaxDiskUsage | float | 0.0 - 1.0 | Maximum allowed disk usage (0.0 - 1.0). Files are removed until usage drops below this value | |
![]() |
inSortingOrder | SortingOrder | Sorting order by file size. Descending starts from biggest files, Ascending from smallest | ||
![]() |
inMask | str | Filter pattern | ||
![]() |
inMaskType | FileNameFilter | FileNameFilter.Wildcard | Filter type to use with the mask | |
![]() |
inRecursive | bool | False | Process subdirectories recursively | |
![]() |
inRemoveDirectories | bool | True | Specifies whether to also delete directories that become empty after files are deleted from them | |
![]() |
outRemoved | list[str] | List of actually deleted entries | ||
![]() |
outRemovedSize | int | Size of the deleted files in bytes |


