protected function cleanOutputFile(File $file)
    {
        $path = $file->getRealPath();

        if ($file->isDir()) {
            chmod($path, $this->getDirectoryCreationMode());
            $this->dispatcher->dispatch(TranscodeEvents::DIR_MODIFIED, new FileEvent($path));
        } else {
            chmod($path, $this->getFileCreationMode());
            $this->dispatcher->dispatch(TranscodeEvents::FILE_MODIFIED, new FileEvent($path));
        }
    }