Implement FILEMAN:Unzip(string zipPath, string targetPath, int strip)

Unzip zip file at `zipPath` to `targetPath`.
`strip` is optional and defaults to `0`. If set to a number larger than
`0`, that many components are removed from the paths of the extracted
files. e.g. `a/b/c` is replaced with `b/c` when stripping one component
or just `c` when stripping two.
Returns whether all files were extracted successfully.
This commit is contained in:
Martin Natano
2022-03-06 19:12:15 +01:00
committed by teejusb
parent ca86f80743
commit 67d1c78450
18 changed files with 10631 additions and 2 deletions
+1
View File
@@ -1596,6 +1596,7 @@
<Function name='GetDirListing'/>
<Function name='GetFileSizeBytes'/>
<Function name='GetHashForFile'/>
<Function name='Unzip'/>
</Class>
<Class name='RageInput'>
<Function name='GetDescriptions'/>
+6
View File
@@ -4860,6 +4860,12 @@ prev_note_name, succeeded = options:NoteSkin("cel")
<Function name='GetHashForFile' return='int' arguments='string sPath'>
Returns the hash of the file at <code>sPath</code>.
</Function>
<Function name='Unzip' return='bool' arguments='string zipPath, string targetPath, int strip'>
Unzips zip file at <code>zipPath</code> to <code>targetPath</code>.<br />
<code>strip</code> is optional and defaults to <code>0</code>.
If set to a number larger than <code>0</code>, that many components are removed from the paths of the extracted files. e.g. <code>a/b/c</code> is replaced with <code>b/c</code> when stripping one component or just <code>c</code> when stripping two.<br />
Returns <code>true</code> if all files were extracted successfully.
</Function>
</Class>
<Class name='RageInput'>
<Description>