Thread overview
[Issue 19756] Add extended attributes support to std.file
Mar 20, 2019
Vladimir Panteleev
Mar 20, 2019
Richard Cattermole
Mar 20, 2019
Vladimir Panteleev
Oct 12, 2020
starcanopy
March 20, 2019
https://issues.dlang.org/show_bug.cgi?id=19756

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dlang-bugzilla@thecybershad
                   |                            |ow.net

--
March 20, 2019
https://issues.dlang.org/show_bug.cgi?id=19756

Richard Cattermole <alphaglosined@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alphaglosined@gmail.com

--- Comment #1 from Richard Cattermole <alphaglosined@gmail.com> ---
I found out a few details for Windows.

To list all extended attributes use FindFirstStreamW and FindNextStreamW providing the file name.

To read or write attributes, use standard file IO functions but use the file name in the format of: "filename:attribute:$DATA". Note that ":$DATA" will be appended if gotten from e.g. FindFirstStreamW.

DigitalMars libc will not work for interacting with the attributes. But MSVC's will. I would recommend using WriteFile and ReadFile from WinAPI instead of using the libc abstraction.

To delete an attribute you can use CreateFileW (on close). Note: if you delete the stream "filename::$DATA" the file will be deleted.

We also need to create fileapi.h as part of the Windows bindings. Its missing and contains the two main functions with their related declarations.

While we are at it, it might be a good idea to extend std.mmap to be able to use these attributes as a source of a file (if possible).

--
March 20, 2019
https://issues.dlang.org/show_bug.cgi?id=19756

--- Comment #2 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
I think those are the alternate data streams I mentioned. NTFS extended attributes ("EA") are different. See e.g. the documentation for ZwQueryEaFile.

--
October 12, 2020
https://issues.dlang.org/show_bug.cgi?id=19756

starcanopy <starcanopy@protonmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |starcanopy@protonmail.com
         Depends on|                            |21306


Referenced Issues:

https://issues.dlang.org/show_bug.cgi?id=21306
[Issue 21306] Add D Conversion of Fileapi.h
--