aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/IO
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2025-05-04 16:40:34 +0200
committerGitHub <noreply@github.com>2025-05-04 08:40:34 -0600
commit0c3ba30de214eddcd6118c3b695b08e5482bf7ed (patch)
treea862a90f6c78cd61f78e5af7b75611a37f527ccf /MediaBrowser.Model/IO
parent4096c973c623a72525843d5fe278d1f36fbbc58a (diff)
Cleanup file related code (#14023)
Diffstat (limited to 'MediaBrowser.Model/IO')
-rw-r--r--MediaBrowser.Model/IO/AsyncFile.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/MediaBrowser.Model/IO/AsyncFile.cs b/MediaBrowser.Model/IO/AsyncFile.cs
index 3c8007d1c..a9db6b81c 100644
--- a/MediaBrowser.Model/IO/AsyncFile.cs
+++ b/MediaBrowser.Model/IO/AsyncFile.cs
@@ -27,6 +27,14 @@ namespace MediaBrowser.Model.IO
};
/// <summary>
+ /// Creates, or truncates and overwrites, a file in the specified path.
+ /// </summary>
+ /// <param name="path">The path and name of the file to create.</param>
+ /// <returns>A <see cref="FileStream" /> that provides read/write access to the file specified in path.</returns>
+ public static FileStream Create(string path)
+ => new FileStream(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous);
+
+ /// <summary>
/// Opens an existing file for reading.
/// </summary>
/// <param name="path">The file to be opened for reading.</param>