我想用PHP压缩一个.txt文件,同时保持文件扩展名。当我解压缩.gz文件时,.gz文件中的扩展名(.txt)被删除。 (test.txt变 - >test) 这里是我的PHP代码,例如压缩test.txt成.gz文件: <?php
// Name of the file we are compressing
$file = "test.txt";
// Name of the gz f
char buffer[1001];
for(;!gzeof(m_fHandle);){
gzread(m_fHandle, buffer, 1000);
The file I'm handling is more than 1GB.
我是否将整个文件加载到缓冲区?或者我应该malloc和分配的大小? 或者我应该逐行加载它?该文件具有用于区分EOL的“\ n”。如果是这