Deno.removesync
removeSync
-
removeSync(path: string, options?: RemoveOptions): void
-
同步删除指定的文件或目录。
Synchronously removes the named file or directory.
Deno.removeSync("/path/to/empty_dir/or/file"); Deno.removeSync("/path/to/populated_dir/or/file", { recursive: true });
当权限被拒绝、路径找不到或者为非空目录且
recursive
未设置为true
,则抛出异常。Throws error if permission denied, path not found, or path is a non-empty directory and the
recursive
option isn’t set totrue
.需要
allow-write
权限。Requires
allow-write
permission.
参数
- ##### path: string
- ##### Optional options: [RemoveOptions](interfaces/deno.removeoptions.html)