compress a file with gzip

redsuitee

Member
I need to compress a file with gzip through openedge editor but I don't know how, is it possible?
Anybody please help.
 
I don't have access to *nix now, but could you try ... OS-COMMAND SILENT VALUE(vGZIPCommand).
where vGZIPCommand is your gzip command (ex: gzip -c myfile > myzipfile.gz) ?
 
Hello, I did not use GZIP but this may serve as a guide you:

[TABLE="class: outer_border, width: 500"]
[TR]
[TD]DEFINE VARIABLE c-file1 AS CHAR.
DEFINE VARIABLE c-file2 AS CHAR.


c-file1 = "C:\TEMP\citivta.zip".
c-file2 = "C:\TEMP\citivta.txt".


OS-COMMAND SILENT VALUE("z-rar.bat " + c-file1 + ' ' + c-file2).
[/TD]
[/TR]
[/TABLE]

Generate a batch file (z-rar.bat) as follows.

[TABLE="class: outer_border, width: 500"]
[TR]
[TD]@echo off
set OLDPATH=%PATH%
set PATH=C:\Archivos de programa\WinRAR\;%PATH%
rar a -ep %1 %2
set PATH=%OLDPATH%
[/TD]
[/TR]
[/TABLE]

Regards.
 
Basically you can submit every OS command through the ABL using OS-COMMAND. You just need to be aware, especially on *nix systems, there might be security issues because the sub process started from the ABL to execute the OS command obviously can not elevate it's privileges.

Heavy Regards, RealHeavyDude.
 
Back
Top