move_file()

audeer.move_file(src_path, dst_path)[source]

Move a file independent of operating system.

As os.rename() works differently under Unix and Windows and shutil.move() can be slow, we use os.replace() to move the file.

Warning

audeer.move_file() is deprecated, please use audeer.move() instead.

Parameters
  • src_path – source file path

  • dst_path – destination file path

Examples

>>> path = mkdir("folder")
>>> src_path = touch(path, "file1")
>>> dst_path = os.path.join(path, "file2")
>>> move_file(src_path, dst_path)
>>> list_file_names(path, basenames=True)
['file2']