sapling/eden/fs/cli/filesystem.py
Ratnadeep Joshi 6447950e1a Move cli/ directory from eden/ to eden/fs (Without changing namespace)
Summary:
[edenfs] Move cli/ directory from eden/ to eden/fs (Without changing
namespace)

Reviewed By: simpkins

Differential Revision: D20505093

fbshipit-source-id: 1975afac2ca1cd70ca407dde485c97254f4cc1e9
2020-03-25 11:18:30 -07:00

29 lines
701 B
Python

#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
import abc
import os
from . import util
class FsUtil(abc.ABC):
@abc.abstractmethod
def mkdir_p(self, path: str) -> str:
"""Performs `mkdir -p <path>` and returns the path."""
@abc.abstractmethod
def statvfs(self, path: str) -> os.statvfs_result:
"""Calls os.statvfs on the mount"""
class LinuxFsUtil(FsUtil):
def mkdir_p(self, path: str) -> str:
return util.mkdir_p(path)
def statvfs(self, path: str) -> os.statvfs_result:
return os.statvfs(path)