# Path: foil/filesys.py
# def ensure_file_directory(file_path: str):
#     """Ensure that a directory path exists."""
# 
#     ensure_directory(os.path.dirname(file_path))


import ftplib
import os
import shutil
import urllib
import urllib.request
from collections import deque, defaultdict
from enum import Enum
from ftplib import FTP
from typing import Tuple, List, Iterable
from foil.filesys import ensure_file_directory



__all__ = ('ftp_listing_paths',)

FTP_URL_TEMPLATE = 'ftp://{user}:{password}@{host}:{port}'

DIRECTORY_FLAG = 'd'
FILE_FLAG = '-'
LINK_FLAG = 'l'


class ListingType(Enum):
    directory = DIRECTORY_FLAG
    file = FILE_FLAG
    link = LINK_FLAG

# Path: foil/filesys.py
# def ensure_file_directory(file_path: str):
#     """Ensure that a directory path exists."""
# 
#     ensure_directory(os.path.dirname(file_path))


# Path: foil/ftp.py
import ftplib
import os
import shutil
import urllib
import urllib.request
from collections import deque, defaultdict
from enum import Enum
from ftplib import FTP
from typing import Tuple, List, Iterable
from foil.filesys import ensure_file_directory




__all__ = ('ftp_listing_paths',)

FTP_URL_TEMPLATE = 'ftp://{user}:{password}@{host}:{port}'

DIRECTORY_FLAG = 'd'
FILE_FLAG = '-'
LINK_FLAG = 'l'


class ListingType(Enum):
    directory = DIRECTORY_FLAG
    file = FILE_FLAG
    link = LINK_FLAG

    other = ''