I have an application which I can not change, that writes to a big 250 GB plain text file. After compressing with GZ it is only 30 GB.This application has no option of compressing it's output, and it can only write to a file name (not to stdout).Is there a way that I can set up for the output to be compressed immediately, without first storing the 250 GB file on my disk?I also need the other way around, to fool the application so that it reads a plaintext file which in reality is compressed.
Is there a way to redirect a file that is written
io redirection;compression
You may have success using /dev/stdout as the filename and piping the output of your application to gzip./dev/stdout is a symlink to /proc/self/fd/1.Similarly, you may be able to use /dev/stdin as a filename and pipe the output of gzip to the application.I say may, because the application may be expecting a seekable file that it writes to (reads from), but /dev/std{in,out} will not be seekable. If this is the case then you are probably lost. You will need to use a seekable file as the target for the application.