private static string ToFopenMode(string file, FileMode mode) { string fopenMode = NativeConvert.ToFopenMode(mode); StdioFileStream.AssertFileMode(file, mode); return(fopenMode); }
private static string ToFopenMode(string file, FileMode mode, FileAccess access) { string fopenMode = NativeConvert.ToFopenMode(mode, access); bool flag = StdioFileStream.AssertFileMode(file, mode); if (mode == FileMode.OpenOrCreate && access == FileAccess.Read && !flag) { fopenMode = "w+b"; } return(fopenMode); }