Example #1
0
        /// <summary>
        /// Gets the reparse point data associated with a file or directory.
        /// </summary>
        /// <param name="path">The file to query</param>
        /// <returns>The reparse point information</returns>
        public ReparsePoint GetReparsePoint(string path)
        {
            DirectoryEntry dirEntry = GetEntry(path);

            ShortResourceHeader hdr = _file.LocateResource(dirEntry.Hash);

            if (hdr == null)
            {
                throw new IOException("No reparse point");
            }

            using (Stream s = _file.OpenResourceStream(hdr))
            {
                byte[] buffer = new byte[s.Length];
                s.Read(buffer, 0, buffer.Length);
                return(new ReparsePoint((int)dirEntry.ReparseTag, buffer));
            }
        }