Bitrix Site Manager

DeleteDirFiles

DeleteDirFiles(
 string check,
 string delete,
 array exclude = array()
)

The DeleteDirFiles function deletes duplicates of files from the directory delete which are also found in the directory check.

Parameters

ParameterDescription
check Absolute path to the directory whose files are checked for existence.
delete Absolute path to the directory in which duplicates of files found in the directory check are to be deleted.
exclude An array of exclusions. Contains short names of files which are not to be deleted.

See Also

Example



<?
// delete all files from the folder /temp1/ which are also found in /temp2/, 
// except index.php
DeleteDirFiles(
    $_SERVER["DOCUMENT_ROOT"]."/temp2", 
    $_SERVER["DOCUMENT_ROOT"]."/temp1", 
    array("index.php")
    );
?>