node.js 파일삭제, 파일 이름 바꾸기
node.js 파일삭제
파일삭제
파일시스템모듈로 파일을 삭제하려면 fs.unlink()을 사용하십시오
fs.unlink()메서드는 지정된 파일을 삭제합니다.
예)
var fs = required('fs');
fs.unlink('mynewfile2.txt', function(err){
if( err ) throw err;
console.log('file deleted');
});
파일 이름 바꾸기
파일 시스템 모듈로 파일의 이름을 바꾸려면 fs.rename()을 사용하십시오
fs.rename()메소드는 지정된 파일의 이름을 바꿉니다.
예)
var fs = required('fs');
fs.rename('mynewfile1.txt', 'myrenamedfile.txt', function(err){
if( err ) throw err;
console.log('File Renamed!');
});
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 4856 | PHP | 7년 전 | 5738 | ||
| 4855 | jQuery | 7년 전 | 3241 | ||
| 4854 | jQuery | 7년 전 | 2232 | ||
| 4853 | jQuery | 7년 전 | 2837 | ||
| 4852 | MySQL | 7년 전 | 2998 | ||
| 4851 | jQuery | 7년 전 | 2345 | ||
| 4850 | jQuery | 7년 전 | 2574 | ||
| 4849 | jQuery | 7년 전 | 4312 | ||
| 4848 | PHP |
|
7년 전 | 4249 | |
| 4847 | jQuery | 7년 전 | 4023 | ||
| 4846 | jQuery | 7년 전 | 2641 | ||
| 4845 | jQuery | 7년 전 | 2158 | ||
| 4844 | jQuery | 8년 전 | 2306 | ||
| 4843 | jQuery | 8년 전 | 3058 | ||
| 4842 | jQuery | 8년 전 | 2902 | ||
| 4841 | jQuery | 8년 전 | 2231 | ||
| 4840 | jQuery | 8년 전 | 1572 | ||
| 4839 | jQuery | 8년 전 | 2469 | ||
| 4838 | jQuery |
이에스씨코리아
|
8년 전 | 2323 | |
| 4837 | jQuery | 8년 전 | 2171 | ||
| 4836 | jQuery | 8년 전 | 2095 | ||
| 4835 | jQuery | 8년 전 | 1829 | ||
| 4834 | jQuery | 8년 전 | 1869 | ||
| 4833 | jQuery | 8년 전 | 1996 | ||
| 4832 | jQuery | 8년 전 | 2187 | ||
| 4831 | jQuery | 8년 전 | 2366 | ||
| 4830 | jQuery | 8년 전 | 2633 | ||
| 4829 | jQuery | 8년 전 | 1806 | ||
| 4828 | jQuery | 8년 전 | 2751 | ||
| 4827 | jQuery | 8년 전 | 2290 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기