Beispiel #1
0
        private static string ToFopenMode(string file, FileMode mode)
        {
            string fopenMode = NativeConvert.ToFopenMode(mode);

            StdioFileStream.AssertFileMode(file, mode);
            return(fopenMode);
        }
Beispiel #2
0
        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);
        }