import os

class Piece:
    length:   int
    owner:    str

    def _get_fields(self):
        # return [getattr(self, field) for field in self.__annotations__]

    def __iter__(self):
        # for field in self._get_fields():
        #     yield field

class ServerFile:
    """
    The representation of a file from the FileSystem class.
    """
    def __init__(self, root: str, path: str) -> None:
        self.pt: PieceTable
        self.cursors: Dict[str, Cursor] = {}

        self.load_from_disk()

    #
    # FILESYSTEM I/O
    #

    def load_from_disk(self) -> None:
        """
        Loads the file from disk and creates the piece table object.
        """
        pass

    def save_to_disk(self) -> None:
        """
        Writes the current buffer to the file on disk, but does not change the
        file representation in RAM.
        """
        pass

    def change_file_path(self, new_path: str) -> None:
        pass

