Directory constructor

public function
 string $path
 string $siteId = nul

Non-static method is called when creating a class instance, allowing to perform actions within it, when creating an object.


$pathFull path to folder
$siteIdSite ID


 $directory=new \Bitrix\Main\IO\Directory($path, $siteId = null);

The following can be done with folder which path was passed to class constructor:

Check, if specified path exists:


Delete the folder and all its contents:


Returns array with object of Directory and File classes, inserted into the current directory. Without recursion.


Create subdirectory wit name, passed as parameter. Returns a created folder object:


Gets folder creation time. Here and later methods return the in the Unix timestamp format. Prints information on directory, specified when creating an object:


Gets time of the last access to folder:


Gets time of the last folder update:


Sets access permissions to folder:


Returns access permissions to folder:


© «Bitrix24», 2001-2022