@@ -61,15 +61,15 @@ internal abstract class XvdCommand<T> : Command<T> where T : XvdCommandSettings
6161{
6262 protected StreamedXvdFile XvdFile = default ! ;
6363
64- protected void Initialize ( XvdCommandSettings settings )
64+ protected void Initialize ( XvdCommandSettings settings , bool requiresWriting )
6565 {
6666 Debug . Assert ( settings . XvcPath != null , "settings.XvcPath != null" ) ;
6767
6868 var path = settings . XvcPath ;
6969
7070 XvdFile = path . StartsWith ( "http" )
7171 ? StreamedXvdFile . OpenFromUrl ( path )
72- : StreamedXvdFile . OpenFromFile ( path ) ;
72+ : StreamedXvdFile . OpenFromFile ( path , requiresWriting ) ;
7373
7474 XvdFile . Parse ( ) ;
7575 }
@@ -89,7 +89,7 @@ internal abstract class CryptoCommand<T> : XvdCommand<T> where T : CryptoCommand
8989
9090 protected bool Initialize ( CryptoCommandSettings settings , out KeyEntry entry )
9191 {
92- base . Initialize ( settings ) ;
92+ base . Initialize ( settings , requiresWriting : true ) ;
9393
9494 Debug . Assert ( XvdFile != null , "XvdFile != null" ) ;
9595
@@ -158,7 +158,7 @@ public sealed class Settings : XvdCommandSettings
158158
159159 public override int Execute ( CommandContext context , Settings settings )
160160 {
161- Initialize ( settings ) ;
161+ Initialize ( settings , requiresWriting : false ) ;
162162
163163 Debug . Assert ( XvdFile != null , "XvdFile != null" ) ;
164164
@@ -241,7 +241,7 @@ public sealed class Settings : XvdCommandSettings;
241241
242242 public override int Execute ( CommandContext context , Settings settings )
243243 {
244- Initialize ( settings ) ;
244+ Initialize ( settings , requiresWriting : false ) ;
245245
246246 Debug . Assert ( XvdFile != null , "XvdFile != null" ) ;
247247
0 commit comments