vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function copyFile

Copies a file.

void copyFile (
  GenericPath!(vibe.core.path.PosixPathFormat) from,
  GenericPath!(vibe.core.path.PosixPathFormat) to,
  bool overwrite = false
) @safe;

void copyFile (
  string from,
  string to
) @safe;

Note that attributes and time stamps are currently not retained.

Parameters

NameDescription
from Path of the source file
to Path for the destination file
overwrite If true, any file existing at the destination path will be overwritten. If this is false, an exception will be thrown should a file already exist at the destination path.

Throws

An Exception if the copy operation fails for some reason.

Authors

Sönke Ludwig

Copyright

© 2012-2019 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.