- <?php
- $newfile = '11.txt';
- // $newfile 파일 생성
- $fmodify_w = fopen($newfile, "w");
- fputs($fmodify_w, "파일추가");
- fclose($fmodify_w);
- if(file_exists($newfile)){
- echo "파일 있음<br>\n";
- }
- else{
- echo "파일 없음<br>\n";
- }
- // 파일 있음
- system("ls");
- // 11.txt
- ?>
--------------------------------------------------------------------------------------------
bool file_exists ( string $filename )
4. 라인
파일 존재 확인합니다.
'php5 > 파일관련함수' 카테고리의 다른 글
파일 전체 읽기 - int fpassthru ( resource $handle ) (0) | 2014.01.10 |
---|---|
파일 사용시 접근 잠금 - bool flock ( resource $handle , int $operation ) (0) | 2014.01.10 |
파일 복사 - bool copy ( string $source , string $dest ) (0) | 2014.01.10 |
시스템 명령어 실행2 - string exec ( string $command ) (0) | 2014.01.10 |
시스템 명령어 실행1 - string system ( string $command ) (0) | 2014.01.10 |