diff options
author | Jürg Billeter <j@bitron.ch> | 2020-03-05 08:57:21 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2020-04-27 08:32:32 +0000 |
commit | c20e921158f033cf3efedfb9255867f6500d9e8d (patch) | |
tree | d827dadfeb84a84fa004ab9f0a35795019113f92 /src/buildstream/storage/directory.py | |
parent | 236382d7403338ca216769de73d18ffb6f5d3fda (diff) | |
download | buildstream-c20e921158f033cf3efedfb9255867f6500d9e8d.tar.gz |
storage: Add Directory.stat() method
Diffstat (limited to 'src/buildstream/storage/directory.py')
-rw-r--r-- | src/buildstream/storage/directory.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/buildstream/storage/directory.py b/src/buildstream/storage/directory.py index bb9d78f7e..5d85cbe46 100644 --- a/src/buildstream/storage/directory.py +++ b/src/buildstream/storage/directory.py @@ -32,6 +32,7 @@ See also: :ref:`sandboxing`. """ +import os from typing import Callable, Optional, Union, List from .._exceptions import BstError @@ -208,6 +209,18 @@ class Directory: """ raise NotImplementedError() + def stat(self, *paths: str, follow_symlinks: bool = False) -> os.stat_result: + """ Get the status of a file. + + Args: + *paths: A list of strings which are all path components. + follow_symlinks: True to follow symlinks. + + Returns: + A `os.stat_result` object. + """ + raise NotImplementedError() + def open_file(self, *paths: str, mode: str = "r"): """ Open file and return a corresponding file object. In text mode, UTF-8 is used as encoding. |