b2sdk.sync.file

class b2sdk.sync.file.File(name, versions)[source]

Bases: object

Hold information about one file in a folder.

The name is relative to the folder in all cases.

Files that have multiple versions (which only happens in B2, not in local folders) include information about all of the versions, most recent first.

__init__(name, versions)[source]
Parameters
  • name (str) – a relative file name

  • versions (list) – a list of file versions

name
versions
latest_version()[source]

Return the latest file version.

class b2sdk.sync.file.FileVersion(id_, file_name, mod_time, action, size)[source]

Bases: object

Hold information about one version of a file.

__init__(id_, file_name, mod_time, action, size)[source]
Parameters
  • id (str) – the B2 file id, or the local full path name

  • file_name (str) – a relative file name

  • mod_time (int) – modification time, in milliseconds, to avoid rounding issues with millisecond times from B2

  • action (str) – “hide” or “upload” (never “start”)

  • size (int) – a file size

id_
name
mod_time
action
size