From 9a18c230cfd88996b43c8ff7c59a195fb34ed3cf Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 4 Oct 2022 10:44:09 -0700 Subject: Use file system abstraction to handle retries automatically Fixes 4791 --- src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/api') diff --git a/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs b/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs index 26184462..cd987555 100644 --- a/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs +++ b/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs @@ -3,6 +3,7 @@ namespace WixToolset.Extensibility.Services { using System; + using System.IO; /// /// Abstracts basic file system operations. @@ -32,6 +33,15 @@ namespace WixToolset.Extensibility.Services /// The destination file. void MoveFile(string source, string destination); + /// + /// Opens a file. + /// + /// The file to open. + /// A System.IO.FileMode value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. + /// A System.IO.FileAccess value that specifies the operations that can be performed on the file. + /// A System.IO.FileShare value specifying the type of access other threads have to the file. + FileStream OpenFile(string path, FileMode mode, FileAccess access, FileShare share); + /// /// Executes an action and retries on any exception a few times with short pause /// between each attempt. Primarily intended for use with file system operations -- cgit v1.2.3-55-g6feb