以下常量由 fs.constants 输出。

    并非所有操作系统都可以使用每个常量。

    To use more than one constant, use the bitwise OR | operator.

    Example:

    1. const fs = require('fs');
    2. const {
    3. O_RDWR,
    4. O_CREAT,
    5. O_EXCL
    6. } = fs.constants;
    7. fs.open('/path/to/my/file', O_RDWR | O_CREAT | O_EXCL, (err, fd) => {
    8. // ...
    9. });