backshift_file_mod module¶
An abstract representation of a file of various kinds, including directories.
Used as a bridge between stat-data and the repo, or the repo and tar output.
- class backshift_file_mod.Backshift_file(repo, file_, filename, verbose=False)[source]¶
Bases:
object
An abstract representation of a file of various kinds, including directories.
Used as a bridge between stat-data and the repo, or the repo and tar output.
- get_real_length()[source]¶
Compute the real length of the file (as opposed to what’s in st_size, by adding up the hash keys’ lengths.
- init_from_lstat_result(lstat_result, can_do_device_files=True)[source]¶
Save a file in the repository.
- init_from_string(file_)[source]¶
Construct (initialize, really) a Backshift file from the file like object we get from reading a file’s metadata.
- kind_dict = {b'block_device': 'b', b'character_device': 'c', b'directory': 'd', b'fifo': 'p', b'hardlink': 'h', b'regular_file': '-', b'symlink': 'l'}¶
- max_digits = 1¶
- tail_special(list_, derived_type, prior_filename)[source]¶
Deal with some special cases near the end of a tvf line.
- exception backshift_file_mod.Benign_skipped[source]¶
Bases:
backshift_file_mod.Skipped
An exception to raise when we we skip something unimportant, like a unix domain socket.
- exception backshift_file_mod.Problematic_skipped[source]¶
Bases:
backshift_file_mod.Skipped
An exception to raise when we we skip something we know is important.
- exception backshift_file_mod.Skipped[source]¶
Bases:
Exception
An exception to raise when we are passed a file of an invalid (unknown) type, including unix domain sockets.
- exception backshift_file_mod.Unknown_skipped[source]¶
Bases:
backshift_file_mod.Skipped
An exception to raise when we skip something that could conceivably be important - IOW, an unknown file type.
- backshift_file_mod.get_can_do_device_files()[source]¶
Return True iff it looks like the Python interpreter has the necessary support to backup device files.