115 {
116 if (fileInfo == null)
117 {
118 throw new ArgumentNullException("fileInfo");
119 }
120 if (fileSecurity == null)
121 {
122 throw new ArgumentNullException("fileSecurity");
123 }
124 FileShare fileShare = share & ~FileShare.Inheritable;
125 if (mode < FileMode.CreateNew || mode > FileMode.Append)
126 {
128 }
129 if ((fileShare < FileShare.None) || fileShare > (FileShare.ReadWrite | FileShare.Delete))
130 {
132 }
133 if (bufferSize <= 0)
134 {
136 }
137 if ((rights &
FileSystemRights.Write) == 0 && (mode == FileMode.Truncate || mode == FileMode.CreateNew || mode == FileMode.Create || mode == FileMode.Append))
138 {
140 }
142 try
143 {
145 }
146 catch
147 {
149 throw;
150 }
151 }
static unsafe SafeFileHandle CreateFileHandle(string fullPath, FileMode mode, FileSystemRights rights, FileShare share, FileOptions options, FileSecurity security)
static FileAccess GetFileStreamFileAccess(FileSystemRights rights)
static string Argument_InvalidFileModeAndFileSystemRightsCombo
static string ArgumentOutOfRange_NeedPosNum
static string ArgumentOutOfRange_Enum
static string Format(string resourceFormat, object p1)