Back to Aurora Vision Library Lite website
You are here: Start » System » File System » RemoveFile_ByDiskUsage
RemoveFile_ByDiskUsage
| Header: | STD.h |
|---|---|
| Namespace: | avl |
Removes files sorted by size until disk usage drops below the specified threshold.
Syntax
C++
Python
void avl::RemoveFile_ByDiskUsage ( const atl::Directory& inDirectory, float inMaxDiskUsage, const avl::SortingOrder::Type& inSortingOrder, const atl::String& inMask, const avl::FileNameFilter::Type& inMaskType, bool inRecursive, bool inRemoveDirectories, atl::Array<atl::File>& outRemoved, atl::int64& outRemovedSize )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inDirectory | const Directory& | Directory from which the files will be deleted | ||
![]() |
inMaxDiskUsage | float | 0.0 - 1.0 | 0.8f | Maximum allowed disk usage (0.0 - 1.0). Files are removed until usage drops below this value |
![]() |
inSortingOrder | const SortingOrder::Type& | Descending | Sorting order by file size. Descending starts from biggest files, Ascending from smallest | |
![]() |
inMask | const String& | \"*\" | Filter pattern | |
![]() |
inMaskType | const FileNameFilter::Type& | 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 | Array<File>& | List of actually deleted entries | ||
![]() |
outRemovedSize | int64& | Size of the deleted files in bytes |
Errors
List of possible exceptions:
| Error type | Description |
|---|---|
| DomainError | inMaxDiskUsage must be in range [0.0, 1.0]. |


