IsoArchive.Save

Save(string, IsoSaveOptions)

Saves the ISO image to the specified path.

public void Save(string path, IsoSaveOptions saveOptions = null)
ParameterTypeDescription
pathStringThe path where the ISO image will be saved.
saveOptionsIsoSaveOptionsOptions to save ISO archive with.

Exceptions

exceptioncondition
InvalidOperationExceptionThrown when the archive is not in editing mode.
ArgumentNullExceptionThrown when the path is null.
DirectoryNotFoundExceptionThrown when the specified path is invalid, such as being on an unmapped drive.
IOExceptionThrown when the file is already open.
UnauthorizedAccessExceptionThrown when access to the file path is denied.
PathTooLongExceptionThrown when the specified path exceeds the system-defined maximum length.

Examples

The following example shows how to save an ISO archive to a file:

// Create a new empty ISO archive
using(IsoArchive isoArchive = new IsoArchive())
{
    // Add files to the ISO archive
    isoArchive.CreateEntry("example_file.txt", "path_to_file.txt");

    // Save the ISO archive to a file
    isoArchive.Save("new_archive.iso");
}

See Also


Save(Stream, IsoSaveOptions)

Saves the ISO image to the specified stream.

public void Save(Stream stream, IsoSaveOptions saveOptions = null)
ParameterTypeDescription
streamStreamThe stream where the ISO image will be saved.
saveOptionsIsoSaveOptionsOptions to save ISO archive with.

Exceptions

exceptioncondition
InvalidOperationExceptionThrown when the archive is not in editing mode.
ArgumentNullExceptionThrown when the stream is null.
ArgumentExceptionThrown when the stream is not writable.

Examples

The following example shows how to save an ISO archive to a memory stream:


 // Create a new empty ISO archive
 using(IsoArchive isoArchive = new IsoArchive())
 {
     // Add files to the ISO archive
     isoArchive.CreateEntry("example_file.txt", "path_to_file.txt");

     // Save the ISO archive to a memory stream
     isoArchive.Save(memoryStream);
 }

See Also