deno.openoptions

🌙
手机阅读
本文目录结构

继承关系

  • OpenOptions

索引

Properties

Properties

Optional append

append: boolean

设置追加模式的选项。 当为 true 时,表示写入将追加到文件中,而不是覆盖先前的内容。 请注意,设置 { write: true, append: true } 与仅设置 { append: true } 具有相同的效果。

Sets the option for the append mode. This option, when true, means that writes will append to a file instead of overwriting previous contents. Note that setting { write: true, append: true } has the same effect as setting only { append: true }.

Optional create

create: boolean

设置选项以允许创建新文件(如果指定路径尚不存在)。 需要使用写权限或追加权限。

Sets the option to allow creating a new file, if one doesn’t already exist at the specified path. Requires write or append access to be used.

Optional createNew

createNew: boolean

默认为 false。 如果设置为 true,则在目标位置不允许存在文件、目录或符号链接。 需要使用写权限或追加权限。 当 createNew 设置为 true 时,create 和 truncate 被忽略。

Defaults to false. If set to true, no file, directory, or symlink is allowed to exist at the target location. Requires write or append access to be used. When createNew is set to true, create and truncate are ignored.

Optional mode

mode: number

创建文件时使用的权限(在进程调用 umask 之前默认为 0o666)。 在 Windows 上此选项被忽略。

Permissions to use if creating the file (defaults to 0o666, before the process’s umask). Ignored on Windows.

Optional read

read: boolean

设置读取访问权限的选项。 当为 true 时,表示该文件在打开后即处于可读状态。

Sets the option for read access. This option, when true, means that the file should be read-able if opened.

Optional truncate

truncate: boolean

设置截断上一个文件的选项。 如果使用此选项后成功打开了文件,则文件的长度将被截断为 0(如果已存在)。 该文件必须具有写访问权限才能打开,才能进行截断。

Sets the option for truncating a previous file. If a file is successfully opened with this option set it will truncate the file to 0 size if it already exists. The file must be opened with write access for truncate to work.

Optional write

write: boolean

设置写访问权限的选项。 当为 true 时,表示该文件在打开时即处于可写状态。 如果该文件已存在,则默认情况下,对该文件的任何写调用都将覆盖其内容,而不会截断该文件。

Sets the option for write access. This option, when true, means that the file should be write-able if opened. If the file already exists, any write calls on it will overwrite its contents, by default without truncating it.

图例说明

  • Property

本文档使用 TypeDoc 生成。

AXIHE / 精选资源

浏览全部教程

面试题

学习网站

前端培训
自己甄别

前端书籍

关于朱安邦

我叫 朱安邦,阿西河的站长,在杭州。

以前是一名平面设计师,后来开始接接触前端开发,主要研究前端技术中的JS方向。

业余时间我喜欢分享和交流自己的技术,欢迎大家关注我的 Bilibili

关注我: Github / 知乎

于2021年离开前端领域,目前重心放在研究区块链上面了

我叫朱安邦,阿西河的站长

目前在杭州从事区块链周边的开发工作,机械专业,以前从事平面设计工作。

2014年底脱产在老家自学6个月的前端技术,自学期间几乎从未出过家门,最终找到了满意的前端工作。更多>

于2021年离开前端领域,目前从事区块链方面工作了