Skip to main content

Manage Old Files

Description

Manages old files.

Function Signature:

def manage_old_files(folder_path: str, files_to_keep: int = 20, file_extension: str = '.log') -> None:

Parameters

  • folder_path (str): Input value for folder_path.
  • files_to_keep (int): Input value for files_to_keep.
  • file_extension (str): Input value for file_extension.

Returns

  • None: The function does not return a value.

Example Usage

# Example usage
folder_path = "example"
files_to_keep = 1
file_extension = "example"
result = manage_old_files(folder_path, files_to_keep, file_extension)
print(result)

Behavior

  • Executes the function logic with the provided arguments.
  • On success, returns the computed value or result object.

Error Handling

  • Exceptions are handled within the function where implemented.