• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/volume/cleaner.php
  • Класс: BitrixDiskVolumeCleaner
  • Вызов: Cleaner::deleteFile
public function deleteFile(DiskFile $file): bool
{
	try
	{
		$task = $this->instanceTask();

		$logData = $task->collectLogData($file);

		if (!$file->delete($task->getOwnerId()))
		{
			$this->collectError($file->getErrors());

			return false;
		}

		$task->log($logData, __FUNCTION__);

		$task->increaseDroppedFileCount();

	}
	catch (MainSystemException $exception)
	{
		$this->collectError(new Error($exception->getMessage(), $exception->getCode()), true, false);

		return false;
	}

	return true;
}