You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Zip/ZipArchive+OnDisk.swift
+25-6Lines changed: 25 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,51 +4,70 @@ import Miniz
4
4
publicextensionZipArchive<URL>{
5
5
/// Creates a `ZipArchive` instance for a disk-based zip archive at the specified file URL.
6
6
///
7
-
/// If the file does not exist, a new archive is created at the specified location.
7
+
/// If the file does not exist and the mode is `readAdd`, a new archive is created at the specified location.
8
+
/// If the mode is `overwrite`, any existing archive at the location is replaced.
9
+
/// If the mode is `readOnly`, the archive is opened strictly for reading, and must already exist.
8
10
///
9
11
/// - Parameter fileURL: The file URL of the zip archive to be read or created.
10
-
/// - Parameter mode: The mode to use. The default, `Mode.readWrite`, lets you read an archive and, optionally, add new files to it. Use `Mode.overwrite` to create a new empty archive and overwrite an existing file if it exists.
12
+
/// - Parameter mode: The mode to use. Use `.readOnly` to read an existing archive, `.readAdd` to read and add
13
+
/// files (creating the archive if it doesn’t exist), or `.overwrite` to create a new empty archive, replacing
14
+
/// any existing file.
11
15
/// - Throws: An error if the initialization fails, such as if the file cannot be read or written.
0 commit comments