Deno.copyFile

\color{red}{function} Deno.copyFile (fromPath: string | URL, toPath: string | URL): Promise<void>

\color{red}{作用}

将一个文件的内容和权限复制到另一个指定的路径,默认情况下根据需要创建一个新文件,否则覆盖。
如果目标路径是目录或不可写,则失败。

原文: Copies the contents and permissions of one file to another specified path, by default creating a new file if needed, else overwriting.
Fails if target path is a directory or is unwritable.

\color{red}{参数}

fromPath : string | URL
toPath : string | URL

原文:
fromPath : string | URL
toPath : string | URL

\color{red}{返回值}

Promise<void>

原文: Promise<void>

\color{red}{示列代码}

await Deno.copyFile( "from.txt", "to.txt" );

\color{red}{其它}

需要为 fromPath 提供 allow-read 权限。
需要为 toPath 提供 allow-write 权限。

原文:
Requires allow-read permission on fromPath.
Requires allow-write permission on toPath.

原文地址:点此跳转

Deno 目录

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容