Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ OSFileStreamStrategy() [2/2]

System.IO.Strategies.OSFileStreamStrategy.OSFileStreamStrategy ( string path,
FileMode mode,
FileAccess access,
FileShare share,
FileOptions options,
long preallocationSize )
inlinepackage

Definition at line 120 of file OSFileStreamStrategy.cs.

121 {
122 string fullPath = Path.GetFullPath(path);
123 _access = access;
124 _lengthCanBeCached = (share & FileShare.Write) == 0 && (access & FileAccess.Write) == 0;
125 _fileHandle = SafeFileHandle.Open(fullPath, mode, access, share, options, preallocationSize);
126 try
127 {
128 if (mode == FileMode.Append && CanSeek)
129 {
131 }
132 else
133 {
134 _appendStart = -1L;
135 }
136 }
137 catch
138 {
140 _fileHandle = null;
141 throw;
142 }
143 }
static SafeFileHandle Open(string fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize)

References System.IO.Strategies.OSFileStreamStrategy._access, System.IO.Strategies.OSFileStreamStrategy._appendStart, System.IO.Strategies.OSFileStreamStrategy._fileHandle, System.IO.Strategies.OSFileStreamStrategy._filePosition, System.IO.Strategies.OSFileStreamStrategy._lengthCanBeCached, System.IO.Strategies.OSFileStreamStrategy.CanSeek, System.Runtime.InteropServices.SafeHandle.Dispose(), System.IO.Path.GetFullPath(), System.L, System.IO.Strategies.OSFileStreamStrategy.Length, Microsoft.Win32.SafeHandles.SafeFileHandle.Open(), and System.options.