English 中文(简体)
哪一os支持影印?
原标题:Which os support copy-on-write?

我在Windows和Windows操作以下代码:

const fs = require("fs/promises")
const {
    constants,
    existsSync
} = require("fs")

async function copy() {
    try {
        await fs.writeFile("demo.txt", "Hello World")
        await fs.copyFile("demo.txt", "copy.txt", constants.COPYFILE_FICLONE_FORCE)
    } finally {
        fs.rm("demo.txt")
        if (existsSync("copy.txt")) fs.rm("copy.txt")
    }
}

copy().catch(console.error)

两种失败的错误信息:

LC:

[Error: ENOTSUP: operation not supported on socket, copyfile  demo.txt  ->  copy.txt ] {
  errno: -95,
  code:  ENOTSUP ,
  syscall:  copyfile ,
  path:  demo.txt ,
  dest:  copy.txt 
}

Windows:

Error: ENOSYS: function not implemented, copyfile  demo.txt  ->  copy.txt ] {
  errno: -4054,
  code:  ENOSYS ,
  syscall:  copyfile ,
  path:  demo.txt ,
  dest:  copy.txt 
}

官方文件指出:

fs.constants.COPYFILE_FICLONE_FORCE: 复印件操作将试图制造一个复印件。 如果平台不支持复印件,则该平台将失败。

大多数服务器操作系统应为Windows服务器或LC。

我确信, no子的开发商取得了一种不奏效的特征,因此,我很想知道什么平台是“fs.constants”。 《公约》缔约方会议年度报告 达尔文、社发司或其他一些顾问?

以下是一些参考信息:

node version: v16.14.2

windows version: windows 10
windows file system: NTFS

linux version: 5.10.109-1-MANJARO
linux core version: 5.10
linux file system: ext4
问题回答

Node.js最初是由Illumos (根据开放式Solaris,以Solais为基础,Solaris是Sun和后来的Ora出售的BSD分销)。

早日,伊卢莫斯进行了大量检测。 令人惊讶。 伊卢莫斯的缺省档案系统是ZFS,有复印件。

但是,其他职业介绍会(At 点 Apple甚至为职业介绍所的一名正式的ZFS司机工作)也提供这种服务,这样,如果你想要使用像ZFS这样的东西的话,你就能够有影印。 I m不确切地说,是否在其他影印-rite档案系统,如Btrfs上,但从理论上说,它应当这样做。

该公司的特有先进金融服务。

如果贵系统档案系统支持的话,你要求开展具体活动(COPYFILE_FICLONE_FORCE),就会工作。 否则,它将失败。 它只是说不存在/自动/倒退。

天主教妇女会只是要让基金会与你复印的档案保持密切联系,但如果(和全国青年论坛)你修改该档案,它实际上将提供一份“真实的”复印件,并适用你的改动。

因此,如果你需要非常/迅速提供档案副本,而且有时(并非全部时间)可能需要在以后加以修改,那么这一选择是明智的。 否则,你可能只是一份“正规”的复印件,让档案系统藏匿起来。





相关问题
哪一os支持影印?

我在Windows和Windows操作以下代码:

Which string classes to use in C++?

we have a multi-threaded desktop application in C++ (MFC). Currently developers use either CString or std::string, probably depending on their mood. So we d like to choose a single implementation (...

How to know whether a copy-on-write page is an actual copy?

When I create a copy-on-write mapping (a MAP_PRIVATE) using mmap, then some pages of this mapping will be copied as soon as I write to specific addresses. At a certain point in my program I would like ...

Does StringBuilder become immutable after a call to ToString?

I distinctly remember from the early days of .NET that calling ToString on a StringBuilder used to provide the new string object (to be returned) with the internal char buffer used by StringBuilder. ...

Why is there no boost::copy_on_write_ptr?

I just saw this nice copy-on-write pointer implementation. It looks pretty generic and useful, so my question is: Is such a class contained in any of the C++ toolkits (boost, loki, etc.)? If not, I d ...

热门标签