달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

○ 디렉토리 생성

File f = new File("디렉토리명");
if(!f.exist()){
f.mkdir();
}

 

○ 파일의 이름을 변경


File f = new File("원본파일명");
File cf = new File("변경할파일명");
if(f.exists()){
f.renameTo(cf);
}


○ 디렉토리 및 파일 삭제


File f = new File("디렉토리명 or 파일명");  //디렉토리의 경우 비어있어야 한다.
if(f.exist()){   
f.delete();   
}

:
Posted by sfeg