Navigation

  • index
  • modules |
  • next |
  • previous |
  • Python reflink documentation »
  • reflink »
  • reflink package

reflink package¶

Submodules¶

reflink.backend module¶

reflink.error module¶

exception reflink.error.ReflinkImpossibleError[source]¶

Bases: Exception

reflink.linux module¶

reflink.reflink module¶

Main module.

reflink.reflink.reflink(oldpath, newpath)[source]¶

Create a reflink from newpath to oldpath. Raises a NotImplementedError when the OS does not implement reflink. Raises a ReflinkImpossibleError when trying to reflink between devices, Raises an IOError when:

  • oldpath is a directory

  • The user has no permissions to create newpath

  • Trying to reflink into a swapfile (ETXTBSY)

For debugability’s sake, reflink _can_ throw IOError in other cases, when the underlying system call fails for another reason. However, these reasons cannot be triggered with this basic call. See man IOCTL-FICLONERANGE(2) and backend.py for more details on these conditions.

Example code:

>>> from reflink import reflink
>>> reflink("large_file.img", "copy_of_file.img")
>>>
reflink.reflink.supported_at(path)[source]¶

Returns True when a path on the filesystem supports reflinking, False otherwise.

Please note that the current implementation verifies this by testing whether it’s possible to reflink.

Module contents¶

Top-level package for Python reflink.

Table of Contents

  • reflink package
    • Submodules
    • reflink.backend module
    • reflink.error module
      • ReflinkImpossibleError
    • reflink.linux module
    • reflink.reflink module
      • reflink()
      • supported_at()
    • Module contents

Previous topic

reflink

Next topic

Contributing

This Page

  • Show Source

Quick search

Navigation

  • index
  • modules |
  • next |
  • previous |
  • Python reflink documentation »
  • reflink »
  • reflink package
© Copyright 2017, Ruben De Smet. Created using Sphinx 8.2.3.