gpt4 book ai didi

Windows cli 相当于 Mac `xattr` 吗?

转载 作者:可可西里 更新时间:2023-11-01 14:22:25 27 4
gpt4 key购买 nike

我以为 Windows 支持的 NTFS 中存在扩展文件属性。我找不到用于访问/更新属性的命令。

是否有支持此功能的 Windows(及其文件系统)风格?

我尝试了 getfattrsetfattr 和许多其他命令。 attrib 也不是。

如果扩展属性要保持跨文件系统的可移植性(即使是在 FUSE 中实现的虚拟文件系统),那么所有目标平台都需要在用户空间中提供一个 api(一个 cmd 或一组 cmd)。

最佳答案

最接近 UNIX attrib 的是 EA:NTFS stores partition metadata称为扩展属性 (EA),它允许将数据存储为文件或文件夹的属性。

EA,例如,are used by IE将文件标识为“从网络下载”。

来自维基百科:

On Windows NT, limited-length extended attributes are supported by FAT, HPFS, and NTFS. This was implemented as part of the OS/2 subsystem. They are notably used by the NFS server of the Interix POSIX subsystem in order to implement Unix-like permissions. The Windows Subsystem for Linux added in the Windows 10 Anniversary Update uses them for similar purposes, storing the Linux file mode, owner, device ID (if applicable), and file times in the extended attributes. Additionally, NTFS can store infinite-length extended attributes in the form of alternate data streams (ADS), a type of resource fork. Plugins for the file manager Total Commander, like NTFS Descriptions and QuickSearch eXtended support filtering the file list by or searching for metadata contained in ADS Streams. Ref.

如果您想做一些与安全相关的事情,您需要查看自由访问控制列表 (DACL) 功能; http://www.windowsecurity.com/articles/Understanding-Windows-NTFS-Permissions.html

Powershell 可以提供帮助 setting the mode and extended file and folder attributes - 但不幸的是,这仅适用于常规属性(不适用于 EA)。

我在 3G-Fuse source 中找到了与 NTFS 属性相关的内容这可能会有帮助。但是,我怀疑那是真的 portable .

关于Windows cli 相当于 Mac `xattr` 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46458355/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com