Feature #3517
closedZIP & UNZIP Support
0%
Description
Hello,
I wanna request an feature as i can see the Windows has it's own API to use for, requesting to add ZIP/UNZIP support as this scripting function is very useful especially to avoid using external sources of .dll or .exe i will provide some of my ideas that how is gonna be useful to be included, also i am not sure if the Windows can support more ZIP extentions like .cab .7z and more.
ZIP Function:
Command Part:
/zip [-cohml] <name> <file or folder> <destination directory> [password]
-c - Stops and closes the zip progress.
-o - Overwrite file it if already exists.
-h - High compression ratio.
-m - Medium compression ratio.
-l - Low compression ratio.
Examples:
/zip -oh testing $qt($adiircdir) $qt($sysdir(downloads) $+ myADI.zip)
/zip -oh testing $qt($adiircdir) $qt($sysdir(downloads) $+ myADI.zip) testpassword
/zip -ol testing $qt($adiircexe) $qt($sysdir(desktop) $+ AdiIRC.zip)
/zip -c testing
Event Part:
on <level>:ZIP:name:<commands>
on *:ZIP:testing:echo -ag ZIP progress of $zip name has been completed, started zipping from $zip($zip).from to $zip($zip).to direction.
Identifiers Part:
$zip - Returns the zip name during a on ZIP event.
$zip(name,[N]) - Returns information about a the Nth zip.
$ziperr - Returns any error during a on ZIP event.
Properites: .name .from .to .pass .ratio
UNZIP Function:
Command Part:
/unzip [-co] <name> <file> <destination directory> [password]
-c - Stops and closes the unzip progress.
-o - Overwrite file it if already exists.
Examples:
/unzip -o testing $qt($sysdir(downloads) $+ myADI.zip) $qt($sysdir(desktop))
/unzip -o testing $qt($sysdir(downloads) $+ myADI.zip) $qt($sysdir(desktop)) testpassword
/unzip -c testing
Event Part:
on <level>:UNZIP:name:<commands>
on *:UNZIP:testing:echo -ag UNZIP progress of $unzip name has been completed, started unzipping from $unzip($unzip).from to $unzip($unzip).to direction.
Identifiers Part:
$unzip - Returns the zip name during a on UNZIP event.
$unzip(name,[N]) - Returns information about a the Nth unzip.
$unziperr - Returns any error during a on UNZIP event.
Properites: .name .from .to .pass
Updated by Per Amundsen over 7 years ago
- Status changed from New to Assigned
The https://msdn.microsoft.com/en-us/library/system.io.compression.zipfile%28v=vs.110%29.aspx API does not support passwords and only works with .NET 4.5+, but I can add a wrapper around that.
Edit: adding a wrapper without password support.
Updated by westor (GR) over 7 years ago
Ok the password is not actually so necessary to be included , i didn't knew that it doesn't support passwords wow! ;p but good news is that you found my idea good for implement.
- Thanks!
Updated by Per Amundsen over 7 years ago
I added this to https://adiirc.com/build/AdiIRC64.exe, but I decided on a little different syntax.
/zip -oculN <name> <source> <dest>
-o - Overwrite target if exists.
-c - Abort and remove the thread.
-u - Unzip instead of zip. (<source> is the zip in this case)
-lN - Use compression method, 0 = no compression, 1 = normal compression, 2 = fastest compression.
$zip(name,[N])
.name - Name of the zip/unzip thread.
.src - Name of the source file or folder.
.dest - Name of the destination file or folder.
.ratio - 0, 1 or 2.
.unzip - $true or $false
$zip - name of the zip/unzip thread.
$ziperr - The error text from any exceptions during the process.
on *:ZIP:<name>:<command>
on *:UNZIP:<name>:<command>
Let me know if it works as you want.
Updated by Per Amundsen over 7 years ago
- Status changed from Assigned to Resolved