koladata

Home
Overview
Fundamentals
Glossary
Cheatsheet
API Reference
Quick Recipes
Deep Dive
Common Pitfalls and Gotchas
Persistent Storage

View the Project on GitHub google/koladata

kd.file_io.FileSystemInteraction API

Interacts with the file system.

FileSystemInteraction.exists(self, filepath: str) -> bool

No description

FileSystemInteraction.glob(self, pattern: str) -> Collection[str]

No description

FileSystemInteraction.is_dir(self, filepath: str) -> bool

No description

FileSystemInteraction.make_dirs(self, dirpath: str)

No description

FileSystemInteraction.open(self, filepath: str, mode: str) -> IO[bytes | str]

No description

FileSystemInteraction.remove(self, filepath: str)

No description

FileSystemInteraction.rename(self, oldpath: str, newpath: str, overwrite: bool = False)

Rename or move a file or a directory.

Atomicity should be an aspirational goal for implementations, especially for
file-to-file renaming. It is unfortunately not an API guarantee at present.

Args:
  oldpath: the file or directory to be moved.
  newpath: the new name of the file or directory.
  overwrite: boolean; if False, it is an error for newpath to be occupied by
    an existing file or directory.