Documentation

DeleteDirFiles

DeleteDirFiles(
 string frDir,
 string toDir,
 array arExept  = array()
);

Deletes all duplictate files from the specified director. These files are also located in another directory. The function does not work recursively.

Function parameters

Parameter Description Available from version
frDir Absolute path to the directory, which files are checked for availablility in the directory, specified in the  toDir parameter.
toDir Absolute path to the directory, in which the files with names will be deleted that are found in the directory, specified  frDir parameter.
arExept An array of exclusions. Contains short names of files which are not to be deleted.

See Also

Examples of use

<?
// delete from folder /temp1/ all files that are available in the folder /temp2/, 
// with exception of index.php file
DeleteDirFiles(
    $_SERVER["DOCUMENT_ROOT"]."/temp2", 
    $_SERVER["DOCUMENT_ROOT"]."/temp1", 
    array("index.php")
    );
?>


© «Bitrix24», 2001-2024
Up