*Special case: file.name.with.many.dots.txt → only first dot used, remaining dots become part of filename inside folder. Users found this intuitive.
Before we fix it, let's decode the jargon. The term "filedot" is not official Microsoft terminology. It usually refers to a file extension error where Windows mishandles the period (dot) in a file name. filedot to folder fixed
def filedot_to_folder_fixed(directory): for file in directory.glob("*"): if file.is_file() and not file.name.startswith('.'): parts = file.name.split('.', 1) if len(parts) == 2: prefix, rest = parts target_dir = directory / prefix target_dir.mkdir(exist_ok=True) new_name = rest target_path = target_dir / new_name # handle collisions counter = 1 while target_path.exists(): stem, ext = os.path.splitext(rest) target_path = target_dir / f"stem_counterext" counter += 1 file.rename(target_path) *Special case: file
Rename file data. → data_file and create a data_fixed/ folder containing a manifest of moved items. The term "filedot" is not official Microsoft terminology
Windows generally prevents you from creating folders that end with a dot or start with one via the standard interface, but software bugs (like those in Google Drive or Adobe) can sometimes create them, leading to "illegal" or undeletable folders.