Shortcuts

mmengine.fileio.copyfile_to_local

mmengine.fileio.copyfile_to_local(src, dst, backend_args=None)[source]

Copy the file src to local dst and return the destination file.

If dst specifies a directory, the file will be copied into dst using the base filename from src. If dst specifies a file that already exists, it will be replaced.

Note

If the backend is the instance of LocalBackend, it does the same thing with copyfile().

Parameters:
  • src (str or Path) – A file to be copied.

  • dst (str or Path) – Copy file to to local dst.

  • backend_args (dict, optional) – Arguments to instantiate the corresponding backend. Defaults to None.

Returns:

If dst specifies a directory, the file will be copied into dst using the base filename from src.

Return type:

str

Examples

>>> # dst is a file
>>> src = 's3://openmmlab/mmengine/file'
>>> dst = '/path/of/file'
>>> # src will be copied to '/path/of/file'
>>> copyfile_to_local(src, dst)
'/path/of/file'
>>> # dst is a directory
>>> dst = '/path/of/dir'
>>> # src will be copied to '/path/of/dir/file'
>>> copyfile_to_local(src, dst)
'/path/of/dir/file'
Read the Docs v: latest
Versions
latest
stable
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.1
v0.9.0
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.4
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.