import glob
import os
from typing import List

from filesystem import FileSystem


class RealFileSystem(FileSystem):

    def list_entries(
        self,
        path: str,
    ) -> List[str]:

        ret = []
        for entry in os.listdir(path):
            ret.append(os.path.join(path, entry))

        return ret

    def read_file_content(
        self,
        path: str,
    ) -> bytes:

        with open(path, "rb") as f:
            return f.read()

    def is_dir(
        self,
        path: str,
    ) -> bool:

        return os.path.isdir(path)

    def is_file(
        self,
        path: str,
    ) -> bool:

        return os.path.isfile(path)
