편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.
최신판 | 당신의 편집 | ||
1번째 줄: | 1번째 줄: | ||
[[category: File]] | [[category: File]] | ||
;unlink | ;unlink | ||
;rm | ;rm | ||
6번째 줄: | 5번째 줄: | ||
==Bash== | ==Bash== | ||
[[category: Bash]] | [[category: Bash]] | ||
< | <source lang='Bash'> | ||
echo 'John Smith' > /tmp/a.txt | echo 'John Smith' > /tmp/a.txt | ||
if [ ! -f /tmp/a.txt ]; then echo 'File not found #1'; fi | if [ ! -f /tmp/a.txt ]; then echo 'File not found #1'; fi | ||
12번째 줄: | 11번째 줄: | ||
rm -f /tmp/a.txt | rm -f /tmp/a.txt | ||
if [ ! -f /tmp/a.txt ]; then echo 'File not found #2'; fi | if [ ! -f /tmp/a.txt ]; then echo 'File not found #2'; fi | ||
# File not found | # File not found | ||
</ | </source> | ||
==PHP== | ==PHP== | ||
[[category: PHP]] | [[category: PHP]] | ||
< | <source lang='PHP'> | ||
file_put_contents('/tmp/a.txt', ' | file_put_contents('/tmp/a.txt', 'John Smith'); | ||
if( !file_exists('/tmp/a.txt') ) echo 'File not found #1'.PHP_EOL; | if( !file_exists('/tmp/a.txt') ) echo 'File not found #1'.PHP_EOL; | ||
24번째 줄: | 23번째 줄: | ||
if( !file_exists('/tmp/a.txt') ) echo 'File not found #2'.PHP_EOL; | if( !file_exists('/tmp/a.txt') ) echo 'File not found #2'.PHP_EOL; | ||
// File not found #2 | // File not found #2 | ||
</ | </source> | ||
==같이 보기== | ==같이 보기== | ||
*[[file_exists]] | *[[file_exists]] | ||