C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[72872] copyfile에 대해서
예성곤 [skyinmine] 3985 읽음    2015-07-20 09:29
copyfile(a,b,1) 과
copyfile(a,b,0) 의 차이는 무엇인가요?

아래와 같이 코딩하였는데...

int i;
   UnicodeString O_file, S_file, show_message;

   OpenDialog1->Filter = "All files (*.*)|*.*";

   if (OpenDialog1->Execute())
      if (FileExists(OpenDialog1->FileName)) {
            O_file = OpenDialog1->FileName;
      }
      else {
            throw(Exception("파일을 찾을수 없다."));
            return;
      }

   if (SaveDialog1->Execute()) {
      if (FileExists(SaveDialog1->FileName)) {
        show_message = SaveDialog1->FileName + "\n\n이미 존재하는 파일입니다. 덮어쓰기를 하시겠습니까?";
        if (MessageDlg(show_message, mtConfirmation,TMsgDlgButtons() << mbYes << mbNo << mbCancel,0) != mrYes ) {
             return;
        }
      }

      S_file = SaveDialog1->FileName;

      if (CopyFile(O_file.w_str(), S_file.w_str(), 0) == true) {
        MessageDlg (SaveDialog1->FileName + "\n\n파일을 복사하였습니다.", mtInformation, TMsgDlgButtons()<<mbOK,0);
      }
      else {
        throw(Exception(SaveDialog1->FileName + "\n\n파일을 복사할 수 없습니다. 시스템 쓰기 권한을 체크하시기 바랍니다."));
        return;
      }

   }

============================

  if (CopyFile(O_file.w_str(), S_file.w_str(), 0) == true) 부분에서

0을 붙이면 오버라이트가 되고
1을 붙이면 오버라이트가 안됩니다.

어떤 차이가 있나요?



+ -

관련 글 리스트
72872 copyfile에 대해서 예성곤 3985 2015/07/20
72873     [자체답변입니다]Re:copyfile에 대해서 예성곤 4972 2015/07/20
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.