PyExplorer/src/core/FileActions.py

14 lines
374 B
Python

from __future__ import annotations
import shutil
from pathlib import Path
class FileActions:
def create_folder(self, parent: Path, name: str) -> None:
(parent / name).mkdir()
def create_file(self, parent: Path, name: str) -> None:
(parent / name).touch(exist_ok=False)
def delete_folder(self, path: Path) -> None:
shutil.rmtree(path)