Project

General

Profile

Feature #3517

ZIP & UNZIP Support

Added by westor (GR) 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Scripting
Target version:
Start date:
06/28/2017
Due date:
% Done:

0%

Estimated time:
Operative System:
All

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

History

#1

Updated by Per Amundsen 5 months 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.

#2

Updated by westor (GR) 5 months 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!

#3

Updated by Per Amundsen 5 months 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.

#4

Updated by Per Amundsen 5 months ago

  • Status changed from Assigned to Resolved
#5

Updated by Per Amundsen 5 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF