If from has multiple values then to must be a directory.
If from has a single value and to exists and is a directory, from will be copied into to.
If from has a single value and to exists and is a file, from must be a file and the contents of to will be replaced with the contents of from otherwise an error will be returned.
If from is an IPFS path, and an MFS path exists with the same name, the IPFS path will be chosen.
If from is an IPFS path and the content does not exist in your node's repo, only the root node of the source file with be retrieved from the network and linked to from the destination. The remainder of the file will be retrieved on demand.
example
// To copy a file awaitipfs.files.cp('/src-file', '/dst-file')
// To copy a directory awaitipfs.files.cp('/src-dir', '/dst-dir')
// To copy multiple files to a directory awaitipfs.files.cp('/src-file1', '/src-file2', '/dst-dir')
If from has multiple values then to must be a directory.
If from has a single value and to exists and is a directory, from will be moved into to.
If from has a single value and to exists and is a file, from must be a file and the contents of to will be replaced with the contents of from otherwise an error will be returned.
If from is an IPFS path, and an MFS path exists with the same name, the IPFS path will be chosen.
If from is an IPFS path and the content does not exist in your node's repo, only the root node of the source file with be retrieved from the network and linked to from the destination. The remainder of the file will be retrieved on demand.
All values of from will be removed after the operation is complete unless they are an IPFS path.
Change mode for files and directories