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
Input value inDirectory const Directory& Directory from which the files will be deleted
Input value 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
Input value inSortingOrder const SortingOrder::Type& Descending Sorting order by file size. Descending starts from biggest files, Ascending from smallest
Input value inMask const String& \"*\" Filter pattern
Input value inMaskType const FileNameFilter::Type& Wildcard Filter type to use with the mask
Input value inRecursive bool False Process subdirectories recursively
Input value inRemoveDirectories bool True Specifies whether to also delete directories that become empty after files are deleted from them
Output value outRemoved Array<File>& List of actually deleted entries
Output value 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].