Questions tagged [alternate-data-stream]

Alternate Data Streams are features of Microsoft's NTFS filesystem. They allow single file to reference multiple independent 'streams' of data and are most commonly used to store file metadata.

On NTFS volumes, each file and directory must have at least one Data Stream. The main, unnamed, data stream refers to the actual data stored in the file. Additional (or Alternate) file streams can be attached to a file/folder by giving unique names to each alternate stream. These alternate streams may then be accessed by specifying the whole path to the file followed by a colon and the name of the stream. For example, this file path refers to the ADS named "MyStream" attached to a file named "MyFile.dat".

C:\Example\MyFile.dat:MyStream

Alternate streams may contain data a normal file can contain, and are not restricted in size, type, or number. Newer versions of Windows (Vista+) will refuse to execute programs stored as alternate streams (a security measure against running invisible EXE's)

50 questions
54
votes
5 answers

How to read and modify NTFS Alternate Data Streams using .NET

How can I read and modify "NTFS Alternate Data Streams" using .NET? It seems there is no native .NET support for it. Which Win32 API's would I use? Also, how would I use them, as I don't think this is documented?
user72491
  • 3,527
  • 5
  • 24
  • 18
34
votes
5 answers

Unblock File from within .net 4 c#

Is there a possibility to unblock a file that is downloaded from the internet from within a c# program. Surfing the internet I have learned, that the information is written in an alternative stream of a (NTFS) file that contains the current zone…
HCL
  • 36,053
  • 27
  • 163
  • 213
28
votes
6 answers

is there something like alternate data streams on any linux filesystem?

On Windows NTFS there is a nice but mostly unused feature called "Alternate Data Streams" (ADS) which I recently used in a hobby-dev project. On Mac HFS+ there is also a similarly nice but mostly unused feature called "named forks". I am thinking…
Peter Parker
  • 29,093
  • 5
  • 52
  • 80
22
votes
3 answers

Is this PInvoke code correct and reliable?

In this question I have searched for a simple solution to unblock files. Thanks to all the comments and answer, I have found a simple solution by PInvoking DeleteFile. It works, but because I've never used file-operations through PInvoke (Win32), I…
HCL
  • 36,053
  • 27
  • 163
  • 213
21
votes
6 answers

NTFS alternate data streams

Today I have seen this weird magic NTFS system supports: each file can have multiple data streams. Basically one could have a file a.txt of 0b size but there can be any number of bytes hidden in a separate data stream for that file. This is strictly…
Peter Perháč
  • 20,434
  • 21
  • 120
  • 152
7
votes
8 answers

NTFS Alternate Data Streams - Good or bad Idea?

I would like to store some Application-Related Metadata for Files, and NTFS Alternate Data Streams (AltDS) would allow me to store this metadata directly on the files rather than in a separate database. I just don't feel like this is a good idea. I…
Michael Stum
  • 177,530
  • 117
  • 400
  • 535
7
votes
2 answers

Working C# Example: Writing & Reading NTFS Alternate Data Stream Under Win7 64 bit

I'd like to be able to use an alternate data stream to store some synchronization information for files that are referenced in a database application I'm building. However, every approach I've found on the web has failed in one way or another. Not…
user553671
6
votes
1 answer

Does APFS actually support Named Forks or just Resource Forks and Extended Attributes?

From version 8.1 until Mountain Lion (10.8), the OS supported a concept called "Named Forks". Named forks are equivalent to "Alternate Data Streams" in Windows. There is a ton of confusion on the internet now between named forks vs the resource fork…
hippietrail
  • 15,848
  • 18
  • 99
  • 158
6
votes
1 answer

Mercurial and NTFS Alternate data stream

How does Mercurial handle Alternate Data Streams (in the NTFS file system)? If it can't handle that, is there a DCVS that does? EDIT: When I change version with update, what happens to the ADS ? Is it lost (erased)? Is it versioned too? Is it…
DonkeyMaster
  • 1,302
  • 4
  • 17
  • 36
6
votes
1 answer

How do I read Windows NTFS's Alternate Data Stream using Java's IO?

I'm trying to have my Java application read all the data in a given path. So files, directories, metadata etc. This also includes one weird thing NTFS has called Alternate Data Stream (ADS). Apparently it's like a second layer of data in a directory…
Pt. Terk
  • 462
  • 4
  • 13
5
votes
3 answers

Powershell - List all alternate data stream information from one directory

My end goal here is to cd to a directory in powershell and then list all the alternate data stream files, then output all their content to a CSV. I currently have the first two parts scripted: cd c:\users\profilename\downloads\ gci -recurse | % { gi…
user3290171
  • 121
  • 1
  • 3
  • 19
5
votes
1 answer

Block a file with Powershell

I want to block (not unblock) a file with Powershell. I want to cause Windows to believe that a file on disk was downloaded from the internet, or whatever other scenario exists such that files become blocked. I need this to test how some software…
Suraj
  • 35,905
  • 47
  • 139
  • 250
4
votes
1 answer

Run GUI powershell script by right clicking on a file

I have built a powershell script using the GUI .net framework that provides the user with a graphical interface to add alternate data streams (ADS) to files on a NTFS file system. Below is the code I wrote for the powershell script: <# This script…
Husk Rekoms
  • 483
  • 12
  • 22
4
votes
4 answers

Using Alternate Data Streams (forks) in Windows 7?

An existing (webbased) project that I work on uses client data and saves reports using the name of the client as file name. Unfortunately, it never filtered this client name so someone entered client names containing a colon (e.g. "workshop:alex")…
Wim ten Brink
  • 25,901
  • 20
  • 83
  • 149
4
votes
1 answer

Is finding all files with a certain Alternate Data Stream an efficient way to store custom tags?

I'm writing a launcher/installer for end users which, among other things, will optionally generate shortcuts in the Start Menu and/or on the Desktop. Ideally, I'd like these shortcuts to support these scenarios: the user changes the displayed name…
Sören Kuklau
  • 19,454
  • 7
  • 52
  • 86
1
2 3 4