def scan(self) -> ['File']:
        """ Scan

        Scan the directory for files and folders and update the file dictionary.

        @return: List of files
        """

        self._files = {}
        output = self._listFilesWin() if isWindows else self._listFilesPosix()
        output = [line for line in output if "__MACOSX" not in line]
        for pathName in output:
            if not pathName:  # Sometimes we get empty lines
                continue

            pathName = pathName[len(self._path) + 1:]
            file = File(self, pathName=pathName, exists=True)
            self._files[file.pathName] = file

        return self.files