本文目录

Deno.chmod

🌙
手机阅读
本文目录结构

chmod

  • chmod(path: string, mode: number): Promise<void>

  • 更改指定路径下特定的文件 / 目录的权限。忽略进程的 umask。

    Changes the permission of a specific file/directory of specified path. Ignores the process’s umask.

      await Deno.chmod("/path/to/file", 0o666);
    

    该模式是 3 个八进制数字的序列。 第一个 / 最左边的数字指定所有者(owner)的权限。 第二个数字指定组(group)的权限。 最后 / 最右边的数字指定其他用户的权限。 例如,在 0o764 模式下,所有者(owner)有读 / 写 / 执行权限(7),组(group)有读 / 写权限(6), 其他用户(4)只有读的权限。

    The mode is a sequence of 3 octal numbers. The first/left-most number specifies the permissions for the owner. The second number specifies the permissions for the group. The last/right-most number specifies the permissions for others. For example, with a mode of 0o764, the owner (7) can read/write/execute, the group (6) can read/write and everyone else (4) can read only.

    说明
    7 read, write, and execute
    6 read and write
    5 read and execute
    4 read only
    3 write and execute
    2 write only
    1 execute only
    0 no permission

    注意:该 API 当前在 Windows 上使用会抛出异常。

    NOTE: This API currently throws on Windows

    需要 allow-write 权限。

    Requires allow-write permission.

参数

-   ##### path: string

-   ##### mode: number

返回 Promise<void>

AXIHE / 精选资源

浏览全部教程

面试题

学习网站

前端培训
自己甄别

前端书籍

关于朱安邦

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

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

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

关注我: Github / 知乎

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

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

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

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

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