Windows cli相当于Mac`xattr`?

我认为
Windows支持的NTFS中存在扩展文件属性.我找不到用于访问/更新属性的cmd.

是否有支持这种情况的Windows(及其文件系统)?

我尝试了getfattr,setfattr和许多其他命令. attrib也不是.

如果扩展属性要在文件系统之间保持可移植性(即使是在FUSE中实现的虚拟属性),那么所有目标平台都需要在用户空间(cmd或cmds集)中显示api.

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

例如,EA用于将文件识别为“已从网上下载”.

来自维基百科:

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. 07002

如果你想做一些安全相关的事情,你想看看自由访问控制列表(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 attribs相关的内容,可能会有所帮助.但是,我怀疑这是真正的portable.

点赞