1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

compress a file with gzip

Discussion in 'Development' started by redsuitee, Nov 10, 2011.

  1. redsuitee

    redsuitee New Member

    I need to compress a file with gzip through openedge editor but I don't know how, is it possible?
    Anybody please help.
     
  2.  
  3. rzr

    rzr Member

    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) ?
     
  4. SergioC

    SergioC Member

    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.
     
  5. redsuitee

    redsuitee New Member

    I think I can use it.
    Thank you very much.
     
  6. RealHeavyDude

    RealHeavyDude Well-Known Member

    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.
     

Share This Page