Collections functions
General functions
Render functions
Theme permission functions
Resource functions

remove_empty_temp_directory()

Description

Remove empty folder from path to file. Helpful to remove a temp directory once the file it was created to hold no longer exists.
This function should be called only once the directory to be removed is empty.

Parameters

ColumnTypeDefaultDescription
$path_to_file string "" Full path to file in filestore.

Return

void

Location

include/file_functions.php lines 239 to 247

Definition

 
function remove_empty_temp_directory(string $path_to_file "")
    {
    if (
$path_to_file != "" && !file_exists($path_to_file))
        {
        
$tmp_path_parts pathinfo($path_to_file);
        
$path_to_folder str_replace(DIRECTORY_SEPARATOR $tmp_path_parts['basename'], ''$path_to_file);
        
rmdir($path_to_folder);
        }
    }

This article was last updated 2nd December 2022 19:35 Europe/London time based on the source file dated 27th October 2022 16:50 Europe/London time.