Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions pyfatfs/FatIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,25 @@
import threading
from typing import Union, Optional

from fs.mode import Mode
from pyfatfs import PyFATException

from pyfatfs.PyFat import PyFat


class DefaultModeReadOnly:
def __init__(self):
self.truncate = False
self.appending = False
self.reading = True
self.writing = False


class FatIO(io.RawIOBase):
"""Wrap basic I/O operations for PyFat."""

def __init__(self, fs: PyFat,
path: str,
mode: Mode = Mode('r')) -> None:
mode = DefaultModeReadOnly()) -> None:
"""Wrap basic I/O operations for PyFat. **Currently read-only**.

:param fs: `PyFat`: Instance of opened filesystem
Expand Down