How to access and modify alternate data streams (ADS) with go

1k Views Asked by At

How can I access and modify metadata stored in NTFS alternate data streams with golang?

I already know about https://github.com/pkg/xattr for accessing metadata stored in extended attribures under linux. However, i need comparable functionality for NTFS.

1

There are 1 best solutions below

0
On BEST ANSWER

Alternate data streams can be accessed using ":StreamName" syntax when opening a file in NTFS.

ads, err := os.Open("C:\Path\To\My\File:MyHiddenStream")
if err != nil {
    panic(err)
}