SD files accessing problems

When accessing files on the SD card, I get:

  1. the file exists, open to append, get System.ArgumentException
  2. file does not exist, open with OpenOrCreate, get system.argumentexception
    Also:
    file does not exist, open with Create, CreateNew or Open all result in ArgumentException

(could not change original post to include category)

I deleted the old thread. Which boards are you using?

uc5550, ucm revE,UD700

Please post simple piece of code showing the error. Have you seen this? http://docs.ghielectronics.com/software/tinyclr/tutorials/filesystem.html

        if (Mode == LogModes.L_Full || Mode == LogModes.L_Streaming)    // write the datapoints to the file
        {
            LogFileName = "TestData" + DateTime.Now.ToString() + ".csv";
            DataDefs.CF.Open(LogFileName, FileMode.OpenOrCreate);
            DataDefs.CF.WriteStrings(LogEntries);
            DataDefs.CF.Close();
        }

The DataDefs.CF.Open:

    //////////////////////////////////////////////////////////////////////////////
    // Open a file
    //  using filemode
    public bool Open(string filename, FileMode fm)
    {
        this.filename = filename;
        try
        {
            file = new FileStream($@"{drive.Name}{filename}", fm, FileAccess.ReadWrite);
        }
        catch (Exception E)
        {
            Debug.WriteLine(E.Message);
        }
        return true;
    }

Found the problem: The filename has illegal characters