Safe access to git files.
Function ensure_dir_exists Ensure a directory exists, creating if necessary.
Function GitFile Create a file object that obeys the git file locking protocol.
Class FileLocked File is already locked.
Function _fancy_rename Rename file with temporary backup file to rollback if rename fails
Class _GitFile File that follows the git locking protocol for writes.
def ensure_dir_exists(dirname):
Ensure a directory exists, creating if necessary.
def _fancy_rename(oldname, newname):
Rename file with temporary backup file to rollback if rename fails
def GitFile(filename, mode='rb', bufsize=-1):

Create a file object that obeys the git file locking protocol.

Only read-only and write-only (binary) modes are supported; r+, w+, and a are not. To read and write from the same file, you can take advantage of the fact that opening a file for write does not actually open the file you request.

Returnsa builtin file object or a _GitFile object
NoteSee _GitFile for a description of the file locking protocol.
API Documentation for Dulwich, generated by pydoctor at 2018-11-17 19:05:54.