Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created February 1, 2026 13:11
Show Gist options
  • Select an option

  • Save wullemsb/b061d465ce6e00e120a541d794050e51 to your computer and use it in GitHub Desktop.

Select an option

Save wullemsb/b061d465ce6e00e120a541d794050e51 to your computer and use it in GitHub Desktop.
var linkOptions = new DataflowLinkOptions { PropagateCompletion = true };
// RECURSION: If the entry is a directory, feed it back into the same block.
getFolderContents.LinkTo(getFolderContents, linkOptions,
entry => Directory.Exists(entry));
// BASE CASE: If the entry is a file, send it forward for hashing.
getFolderContents.LinkTo(computeMD5, linkOptions,
entry => File.Exists(entry));
// Final stage: display the hash.
computeMD5.LinkTo(displayResult, linkOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment