This project is read-only.

Trouble writing to FatImage

Dec 17, 2014 at 4:08 AM

I am new to .NET and usually write in Java, so this may be a obvious question.

I am able to create a FatFileSystem and make directories within it, but I cannot write files to it.

Every time I do, it says that 'Invalid Path'... Here's the code
using (FileStream data = File.Create(dirPath))
                using (system = FatFileSystem.FormatFloppy(data, FloppyDiskType.HighDensity, "SDCARD"))
                    using (Stream output = system.OpenFile(@"scope_record.csv", FileMode.Create))
                        using (
                            Stream input = new FileStream(@"C:\Users\Joseph\Documents\scope_record.csv", FileMode.Open))
                            var bytes = new byte[input.Length];
                            input.Read(bytes, 0, bytes.Length);
                            output.Write(bytes, 0, bytes.Length);
The exception is thrown when initializing Stream output.

I am confused on how the path is invalid, as I tried to follow the simple example on the Home page for DiscUtils.

Dec 20, 2014 at 12:03 AM
Figured it out... it was the underscore ('_') in the file name...