DeleteCommand Class

Summary

Deletes files from the archive. (Command: d).

The builder is DeleteCommandBuilder.

graph BT Type-->Base0["BaseAddLikeSyntaxCommand"] click Base0 "/Cake.7zip/api/Cake.SevenZip.Commands/BaseAddLikeSyntaxCommand" Base0-->Base1["BaseCommand"] click Base1 "/Cake.7zip/api/Cake.SevenZip.Commands/BaseCommand" Base1-->Base2["object"] Type-.->Interface0["IHaveArgumentArchive"] click Interface0 "/Cake.7zip/api/Cake.SevenZip.Arguments/IHaveArgumentArchive" Type-.->Interface1["IHaveArgumentFiles"] click Interface1 "/Cake.7zip/api/Cake.SevenZip.Arguments/IHaveArgumentFiles" Type-.->Interface2["IHaveArgumentDirectories"] click Interface2 "/Cake.7zip/api/Cake.SevenZip.Arguments/IHaveArgumentDirectories" Type-.->Interface3["IHaveArgument"] click Interface3 "/Cake.7zip/api/Cake.SevenZip.Arguments/IHaveArgument" Type-.->Interface4["ICommand"] click Interface4 "/Cake.7zip/api/Cake.SevenZip.Commands/ICommand" Type-.->Interface5["ISupportSwitchIncludeFilenames"] click Interface5 "/Cake.7zip/api/Cake.SevenZip.Switches/ISupportSwitchIncludeFilenames" Type-.->Interface6["ISupportSwitchExcludeFilenames"] click Interface6 "/Cake.7zip/api/Cake.SevenZip.Switches/ISupportSwitchExcludeFilenames" Type-.->Interface7["ISupportSwitchCompressionMethod"] click Interface7 "/Cake.7zip/api/Cake.SevenZip.Switches/ISupportSwitchCompressionMethod" Type-.->Interface8["ISupportSwitchPassword"] click Interface8 "/Cake.7zip/api/Cake.SevenZip.Switches/ISupportSwitchPassword" Type-.->Interface9["ISupportSwitchRecurseSubdirectories"] click Interface9 "/Cake.7zip/api/Cake.SevenZip.Switches/ISupportSwitchRecurseSubdirectories" Type-.->Interface10["ISupportSwitchNtfsAlternateStreams"] click Interface10 "/Cake.7zip/api/Cake.SevenZip.Switches/ISupportSwitchNtfsAlternateStreams" Type-.->Interface11["ISupportSwitchUpdateOptions"] click Interface11 "/Cake.7zip/api/Cake.SevenZip.Switches/ISupportSwitchUpdateOptions" Type-.->Interface12["ISupportSwitchWorkingDirectory"] click Interface12 "/Cake.7zip/api/Cake.SevenZip.Switches/ISupportSwitchWorkingDirectory" Type-.->Interface13["ISupportSwitchSelfExtractingArchive"] click Interface13 "/Cake.7zip/api/Cake.SevenZip.Switches/ISupportSwitchSelfExtractingArchive" Type-.->Interface14["ISupportSwitchFullyQualifiedFilePaths"] click Interface14 "/Cake.7zip/api/Cake.SevenZip.Switches/ISupportSwitchFullyQualifiedFilePaths" Type-.->Interface15["ISupportSwitch"] click Interface15 "/Cake.7zip/api/Cake.SevenZip.Switches/ISupportSwitch" Type["DeleteCommand"] class Type type-node

Syntax

public sealed class DeleteCommand : BaseAddLikeSyntaxCommand, IHaveArgumentArchive, 
    IHaveArgumentFiles, IHaveArgumentDirectories, IHaveArgument, ICommand, 
    ISupportSwitchIncludeFilenames, ISupportSwitchExcludeFilenames, 
    ISupportSwitchCompressionMethod, ISupportSwitchPassword, ISupportSwitchRecurseSubdirectories, 
    ISupportSwitchNtfsAlternateStreams, ISupportSwitchUpdateOptions, 
    ISupportSwitchWorkingDirectory, ISupportSwitchSelfExtractingArchive, 
    ISupportSwitchFullyQualifiedFilePaths, ISupportSwitch

Properties

Name Value Summary
Archive FilePath?
Sets the archive the command operates on.
CommandChar string
Gets the command character. (e.g. "a", "u" or "e"...)
CommandName string
Gets the name of the command. (i.e. "add", "update" or "extract".)
CompressionMethod SwitchCompressionMethod?
Gets or sets the compression method.
Directories DirectoryPathCollection?
Gets or sets the list of Directories the command operates on.

For add and update, adding a directory will add the directory itself to the root of the archive including everything in it.

DirectoryContents DirectoryPathCollection?
Gets or sets the list of Directory-contents the command operates on.

For add and update, adding a directory this way will add the files of the directory to the root of the archive but not the directory itself.

ExcludeFilenames SwitchExcludeFilenameCollection?
Gets or sets the SwitchExcludeFilenameCollection.
Files FilePathCollection?
Gets or sets the list of files this command operates on. These are single files. (I.e. to add to, or to remove from the archive).

For add and update, single files from the file-system will always be placed directly into the archive without any directory-structure.

Setting Files like this in add/update:
Files = new[] {
  new FilePath("C:\\some\\place\\a.txt"),
  new FilePath("C:\\some\\other\\place\\b.txt"),
  new FilePath("C:\\a\\totally\\different\\place\\c.txt")
};
Will result in an archive:
Archive.zip
- a.txt
- b.txt
- c.txt
without any directory structure.
FullyQualifiedFilePaths SwitchFullyQualifiedFilePaths?
Gets or sets the SwitchFullyQualifiedFilePaths.
IncludeFilenames SwitchIncludeFilenameCollection?
Gets or sets the SwitchIncludeFilenameCollection.
NtfsAlternateStreams SwitchNtfsAlternateStreams?
Gets or sets the SwitchNtfsAlternateStreams.
Password SwitchPassword?
Gets or sets the SwitchPassword.
RecurseSubdirectories SwitchRecurseSubdirectories?
Gets or sets the SwitchRecurseSubdirectories.
SelfExtractingArchive SwitchSelfExtractingArchive?
Gets or sets the SwitchSelfExtractingArchive.
Switches IEnumerable<ISwitch?>
Gets all supported switches.
ThrowOnMissingInputFiles bool
Gets a value indicating whether to throw on missing input files.
UpdateOptions SwitchUpdateOptions?
Gets or sets the SwitchUpdateOptions.
WorkingDirectory SwitchWorkingDirectory?
Gets or sets the SwitchWorkingDirectory.

Methods

Name Value Summary
BuildArgumentParams(ProcessArgumentBuilder) void
adds only the arguments to the builder. (i.e. Archive, files, directories).
BuildArguments(ProcessArgumentBuilder) void
Builds the arguments.
Inherited from BaseCommand
GitHub Discussion