본문 바로가기
PowerBuilder

파일 관련 함수 (파워빌더 8.0이상)

by 엔터티 2021. 6. 5.
반응형

ChangeDirectory : 현재 디렉토리를 변경한다.

 

//상위 디렉토리를 현재 디렉토리로 설정
ChangeDirectory("..")

      

 

 

CreateDirector : 새로운 디렉토리를 생성한다

string ls_path = "c:\test"

      CreateDirectory(ls_path)

 

RemoveDirectory : 디렉토리를 삭제한다.

/* 현재 디렉토리는 삭제할 수 없으며 또한 빈 디렉토리이어야 삭제된다. */

   

    String ls_path = "c:\test"

      integer li_filenum

      li_filenum = RemoveDirectory(ls_path)



      IF li_filenum <> 1 THEN

         MessageBox("삭제실패", "현재디렉토리 확인")

      ELSE

        MessageBox("성공", "디렉토리 삭제")

     END IF

 

 

GetCurrentDirectory : 현재 디렉토리를 찾는다.

sle_curr.text = GetCurrentDirectory()

 

 

DirectoryExists : 디렉토리가 존재하는지 검사한다.

String lls_path = "c:\tesst"

IF DirectoryExists(ls_path) THEN

MessageBox("알림!", "디렉토리가 존재합니다.")

ELSE

MessageBox("알림!", "디렉토리가 존재하지 않습니다.")

END IF

 

 

FileCopy : 파일을 복사한다.

Integer li_FileNum

li_FileNum = FileCopy("c:\test\kim.txt", "d:\temp\pb80\test.txt", False)

 

 

FileMove : 파일을 이동시킨다.

Integer li_FileNum|

li_FileNum = FileMove ("D:\temp\pb80\test.txt", "c:\test\dd.txt")

 

반응형

댓글