move_file_if_exists.cpp 746 B

123456789101112131415161718192021222324252627
  1. //
  2. // $Id$
  3. //
  4. #include<__vic/fs.h>
  5. #include<windows.h>
  6. namespace __vic {
  7. bool move_file_if_exists_(const char * , const char * , DWORD );
  8. //----------------------------------------------------------------------------
  9. bool move_file_if_exists(const char *src_path, const char *dest_path)
  10. {
  11. return move_file_if_exists_(src_path, dest_path, MOVEFILE_COPY_ALLOWED);
  12. }
  13. //----------------------------------------------------------------------------
  14. bool move_file_replace_if_exists(
  15. const char *src_path, const char *dest_path)
  16. {
  17. return move_file_if_exists_(src_path, dest_path,
  18. MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING);
  19. }
  20. //----------------------------------------------------------------------------
  21. } // namespace