Example #1
0
        public void HideVersions()
        {
            CDBuilder builder = new CDBuilder();
            builder.UseJoliet = true;
            builder.AddFile("FILE.TXT;1", new byte[] { });

            MemoryStream ms = new MemoryStream();
            SparseStream.Pump(builder.Build(), ms);

            CDReader reader = new CDReader(ms, true, false);
            Assert.AreEqual("\\FILE.TXT;1", reader.GetFiles("")[0]);
            Assert.AreEqual("\\FILE.TXT;1", reader.GetFileSystemEntries("")[0]);

            reader = new CDReader(ms, true, true);
            Assert.AreEqual("\\FILE.TXT", reader.GetFiles("")[0]);
            Assert.AreEqual("\\FILE.TXT", reader.GetFileSystemEntries("")[0]);
        }
        public void HideVersions()
        {
            CDBuilder builder = new CDBuilder();

            builder.UseJoliet = true;
            builder.AddFile("FILE.TXT;1", new byte[] { });

            MemoryStream ms = new MemoryStream();

            SparseStream.Pump(builder.Build(), ms);

            CDReader reader = new CDReader(ms, true, false);

            Assert.AreEqual("\\FILE.TXT;1", reader.GetFiles("")[0]);
            Assert.AreEqual("\\FILE.TXT;1", reader.GetFileSystemEntries("")[0]);

            reader = new CDReader(ms, true, true);
            Assert.AreEqual("\\FILE.TXT", reader.GetFiles("")[0]);
            Assert.AreEqual("\\FILE.TXT", reader.GetFileSystemEntries("")[0]);
        }
Example #3
0
        private void CloneCdDirectory(string dir, CDReader cdr, CDBuilder cdb)
        {
            foreach (string fileName in cdr.GetFiles(dir))
            {
                if (fileName == "\\reactos\\unattend.inf")
                    continue;

                var stream = cdr.OpenFile(fileName, FileMode.Open);
                cdb.AddFile(fileName.Remove(0, 1), stream);
                stream.Close();
            }
            foreach (string dirName in cdr.GetDirectories(dir))
            {
                CloneCdDirectory(dirName, cdr, cdb);
            }
        }