태그 보관물: php5

php5

유닉스 시스템 (“unzip archive.zip”) Zip 파일 자동 추출 표시하지 않고 파일을 자동 추출하는

상태를 표시하지 않고 파일을 자동 추출하는 방법은 무엇입니까?



답변

남자 압축 풀기 :

   -q     perform  operations  quietly  (-qq  = even quieter).  Ordinarily
          unzip prints the names of the files it's extracting or  testing,
          the extraction methods, any file or zipfile comments that may be
          stored in the archive, and possibly a summary when finished with
          each  archive.   The -q[q] options suppress the printing of some
          or all of these messages.


답변

로부터 압축 해제 man 페이지 :

-큐

조용히 작업을 수행합니다 ( -qq = 더 조용함 ). 일반적으로 압축 해제압축 해제 또는 테스트중인 파일의 이름, 추출 방법, 아카이브에 저장 될 수있는 파일 또는 zip 파일 주석 및 각 아카이브가 끝나면 요약 정보를 인쇄합니다. -q [ Q ] 옵션은 이러한 메시지의 일부 또는 전부의 출력을 억제.

그렇습니다 unzip -qq yourfile.zip.


답변

PHP는 그 확장을 가지고

http://php.net/manual/en/book.zip.php

<?php
$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
    $zip->extractTo('/my/destination/dir/');
    $zip->close();
    echo 'ok';
} else {
    echo 'failed';
}
?>


답변

이건 gunzip 명령을 사용하는 것이 좋습니다.

gunzip /path/to/file/filename.z

이것은 또한 자동 출력


답변