aboutsummaryrefslogtreecommitdiffstats
path: root/bsie/reader/stat.py
blob: f42e7fbefa6bba9b6a2663bfad860fc8baeafef5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""The Stat reader produces filesystem stat information.
"""
# standard imports
import os
import typing

# bsie imports
from bsie.utils import errors

# inner-module imports
from . import base

# exports
__all__: typing.Sequence[str] = (
    'Stat',
    )


## code ##

class Stat(base.Reader):
    """Read and return the filesystem's stat infos."""

    def __call__(self, path: str) -> os.stat_result:
        try:
            return os.stat(path)
        except Exception as err:
            raise errors.ReaderError(path) from err


## EOF ##