Provides access to NTFS junction points in .Net.
Exemplo n.º 1
0
        public static Tuple <string, string> CreateJunctionAndTarget(string baseDir)
        {
            var path     = Path.Combine(baseDir, Guid.NewGuid().ToString());
            var junction = Path.Combine(baseDir, Guid.NewGuid().ToString());

            Directory.CreateDirectory(path);
            JunctionPoint.Create(junction, path, true);

            return(Tuple.Create(path, junction));
        }
Exemplo n.º 2
0
        public static void DeleteJunctionAndTarget(string path)
        {
            var target = JunctionPoint.GetTarget(path);

            JunctionPoint.Delete(path);
            if (target != null)
            {
                File.Delete(target);
            }
        }