SC13048: SD Card and FileStream

I am porting some old code onto this new platform. Is this doable?
which NuGet to include, it gives an error for FileStream

            FileStream tw;

            if (File.Exists(tName))
            {
                tw = new FileStream(tName, FileMode.Append, FileAccess.Write);
            }
            else
            {
                IDispPrint("Create: " + tName);
                tw = new FileStream(tName, FileMode.Create, FileAccess.Write);
				
                tw.Write(Encoding.UTF8.GetBytes(tStr), 0, tStr.Length);

                Head = true;
            }

            tw.Write(ReplyStr, 0, ReplyStr.Length);
            tw.Close();

it would be helpful if you post all relevant information, for example which error you get…
howsoever did you take a look at the docs?

https://docs.ghielectronics.com/software/tinyclr/tutorials/file-system.html

Thanks, I included both
GHIElectronics.TinyCLR.IO and GHIElectronics.TinyCLR.Devices.Storage libraries
But it still could not find it

|Error|CS0246|The type or namespace name ‘FileStream’ could not be found (are you missing a using directive or an assembly reference?)

i think for FileStream itself you also need a reference to System.IO
(does Visual Studio tell it to you if you hover your mousepointer over FileStream?)

Thanks that was it :slight_smile:
Since the example only 2 libraries I had removed System.IO earlier

I think you need managed file system on SC13048.

https://docs.ghielectronics.com/software/tinyclr/drivers/software-utility.html