1. how to compress files

what do you guys do to compress files within a program euphoria?
Before I used a copy of gzip.exe, but now it no longer works.

res=system_exec("gzip -c -9 ultmov.txt > ultmov.gz",0) 

Any idea?

new topic     » topic index » view message » categorize

2. Re: how to compress files

sergelli said...

what do you guys do to compress files within a program euphoria?
Before I used a copy of gzip.exe, but now it no longer works.

res=system_exec("gzip -c -9 ultmov.txt > ultmov.gz",0) 

Any idea?

That should still work. What happens if you manually attempt to run gzip from the command line?

new topic     » goto parent     » topic index » view message » categorize

3. Re: how to compress files

In command line works well
But inside of a program, as above, res = 1

running my program in. exe, prompt in the last lines that appear are showing an error

ÑÕ]k╝ésu|uFH?Â{ÖpO╗dîf┬╗├5^ù¯ûC:Æû¹Y¡O¥à·ÉÆ>=▒ôî´åà▄╠8#p´Aè¥UäV┴û§ ┼ð╩1w& 
(╔▓¥·\'z                 «&gzip: >: Invalid argument 
gzip: c:\001Stok\00stok\0000Bin\ultmov.gz: No such file or directoryßÀʼÂÄHâq.®╔]{Ë▄PÄüXÄM½ÀÎ 
 
 
new topic     » goto parent     » topic index » view message » categorize

4. Re: how to compress files

sergelli said...

In command line works well
But inside of a program, as above, res = 1

Hmm.. instead of telling gzip to send the compressed output to stdout and redirecting that into a file, have you tried using the keep option? (Requires gzip 1.6 or later)

Or copying the original file first and then running gzip on the copy?

new topic     » goto parent     » topic index » view message » categorize

5. Re: how to compress files

My version is deprecated.

gzip -V
gzip 1.3.12

new topic     » goto parent     » topic index » view message » categorize

6. Re: how to compress files

sergelli said...

My version is deprecated.

gzip -V
gzip 1.3.12

I missed that you said gzip.exe earlier. This works fine on a sane OS, but you can't do redirection with system_exec() on Windoze. That never worked.

Copying the original file and then compressing the copy with gzip (without either -c or redirection) should still work with system_exec(). This is probably the easiest method, if you have enough space to make a full sized copy of the original file.

Or you can use system(), and find some other method to determine if gzip was successful or not. (Perhaps an MS-DOS batch script that writes the return code of gzip into a text file.)

Or you can use pipeio and write code to take the output of gzip and place it into a file yourself.

new topic     » goto parent     » topic index » view message » categorize

7. Re: how to compress files

following your instructions

res=copyFile ("ultmov.txt","c:\\001Stok\\ultmov.txt",1)
res=system_exec("gzip -9 c:\\001Stok\\ultmov.txt ",0) 

is now working

Thanks jimcbrown

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu