S
S
Sergey Pugovkin2020-08-20 19:07:05
linux
Sergey Pugovkin, 2020-08-20 19:07:05

Popen: gzip data compression on the fly, how?

I want to run linux gzip through popen (lua / php / c), write a string to it and read the already compressed response.

popen('gzip >&1', 'wb')
write(uncompressed_data)
compressed_data = read('*all')
pclose() So

gzip >&1
So?

Do I need to send some special character at the end of uncompressed_data to work properly, or will it immediately compress all incoming data to stdin?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Spartak (Web-StyleStudio), 2020-08-20
@Driver86

https://m.habr.com/ru/post/221849/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question