Skip to content

Instantly share code, notes, and snippets.

View Xseron's full-sized avatar
🎯
Focusing

Kirill Baranov Xseron

🎯
Focusing
  • Kazakstan
  • 01:25 (UTC +05:00)
View GitHub Profile
@Xseron
Xseron / FTP_autoload.py
Last active April 5, 2024 18:05
FTP Autoload is a robust software solution designed to streamline the process of transferring files between local systems and remote servers via FTP (File Transfer Protocol). This project aims to automate and simplify file transfer tasks, enhancing efficiency and reducing manual intervention.
from ftplib import FTP, error_perm
import os.path, os
def remove_ftp_dir(ftp, path):
"""Recursively delete all files and directories within the given directory on the FTP server."""
for (name, properties) in ftp.mlsd(path=path):
print(name)
if name in ['.', '..'] or name.startswith(".") or name.startswith(".."):
continue
elif properties['type'] == 'file':