예제 #1
0
        public void Cyrillic()
        {
#if NET40
            SetupHelper.RegisterAssembly(typeof(FatFileSystem).Assembly);
#else
            SetupHelper.RegisterAssembly(typeof(FatFileSystem).GetTypeInfo().Assembly);
#endif

            string lowerDE = "\x0434";
            string upperDE = "\x0414";

            MemoryStream ms = new MemoryStream();
            using (FatFileSystem fs = FatFileSystem.FormatFloppy(ms, FloppyDiskType.HighDensity, "KBFLOPPY   "))
            {
                fs.FatOptions.FileNameEncoding = Encoding.GetEncoding(855);

                string name = lowerDE;
                fs.CreateDirectory(name);

                string[] dirs = fs.GetDirectories("");
                Assert.Equal(1, dirs.Length);
                Assert.Equal(upperDE, dirs[0]); // Uppercase

                Assert.True(fs.DirectoryExists(lowerDE));
                Assert.True(fs.DirectoryExists(upperDE));

                fs.CreateDirectory(lowerDE + lowerDE + lowerDE);
                Assert.Equal(2, fs.GetDirectories("").Length);

                fs.DeleteDirectory(lowerDE + lowerDE + lowerDE);
                Assert.Equal(1, fs.GetDirectories("").Length);
            }

            FileSystemInfo[] detectDefaultFileSystems = FileSystemManager.DetectFileSystems(ms);

            DiscFileSystem fs2 = detectDefaultFileSystems[0].Open(
                ms,
                new FileSystemParameters {
                FileNameEncoding = Encoding.GetEncoding(855)
            });

            Assert.True(fs2.DirectoryExists(lowerDE));
            Assert.True(fs2.DirectoryExists(upperDE));
            Assert.Equal(1, fs2.GetDirectories("").Length);
        }
예제 #2
0
 private void CompileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (fileLoaded)
     {
         UpdateListbox();
         fs.DeleteDirectory("lua", true);
         fs.CreateDirectory("lua");
         foreach (LuaFile file in lfiles)
         {
             Console.WriteLine("Writing " + file.name);
             SparseStream stream = fs.OpenFile(file.name, FileMode.Create);
             stream.Write(Encoding.ASCII.GetBytes(file.data), 0, file.data.Length);
             stream.Close();
             Console.WriteLine("Wrote");
         }
         MessageBox.Show("Finished saving.", "Dreamcaster");
     }
 }
예제 #3
0
        public void Cyrillic()
        {
            string lowerDE = "\x0434";
            string upperDE = "\x0414";

            MemoryStream ms = new MemoryStream();

            using (FatFileSystem fs = FatFileSystem.FormatFloppy(ms, FloppyDiskType.HighDensity, "KBFLOPPY   "))
            {
                fs.FatOptions.FileNameEncoding = Encoding.GetEncoding(855);

                string name = lowerDE;
                fs.CreateDirectory(name);

                string[] dirs = fs.GetDirectories("");
                Assert.AreEqual(1, dirs.Length);
                Assert.AreEqual(upperDE, dirs[0]); // Uppercase

                Assert.IsTrue(fs.DirectoryExists(lowerDE));
                Assert.IsTrue(fs.DirectoryExists(upperDE));

                fs.CreateDirectory(lowerDE + lowerDE + lowerDE);
                Assert.AreEqual(2, fs.GetDirectories("").Length);

                fs.DeleteDirectory(lowerDE + lowerDE + lowerDE);
                Assert.AreEqual(1, fs.GetDirectories("").Length);
            }

            DiscFileSystem fs2 = FileSystemManager.DetectDefaultFileSystems(ms)[0].Open(
                ms,
                new FileSystemParameters {
                FileNameEncoding = Encoding.GetEncoding(855)
            });

            Assert.IsTrue(fs2.DirectoryExists(lowerDE));
            Assert.IsTrue(fs2.DirectoryExists(upperDE));
            Assert.AreEqual(1, fs2.GetDirectories("").Length);
        }