Changeset 22 in dev for ProjectEditor/FileOperation.cpp


Ignore:
Timestamp:
Dec 29, 2006, 1:55:55 AM (17 years ago)
Author:
dai_9181
Message:

バックアップ用ディレクトリが消去されていたときは、自動生成する。
プロ版の概念を除去。機能制限を解除。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ProjectEditor/FileOperation.cpp

    r3 r22  
    172172}
    173173
    174 void RemoveDirectoryStrong(char *dir_path){
     174void RemoveDirectoryStrong(const char *dir_path){
    175175    HANDLE hFind;
    176176    WIN32_FIND_DATA wfd;
     
    410410        }
    411411
    412         if(!IsFile(temporary)){
     412        if(!IsExistFile(temporary)){
    413413            //保存先ファイルが存在しないとき
    414414            char temp2[MAX_PATH];
     
    566566}
    567567
    568 BOOL IsFile(char *path){
     568bool IsExistFile( const char *FilePath ){
    569569    WIN32_FIND_DATA wfd;
    570570    HANDLE hFind;
    571571
    572     hFind=FindFirstFile(path,&wfd);
    573     if(hFind==INVALID_HANDLE_VALUE){
    574         return 0;
    575     }
    576     FindClose(hFind);
    577 
    578     return 1;
    579 }
     572    hFind = FindFirstFile(FilePath,&wfd);
     573    if( hFind == INVALID_HANDLE_VALUE ){
     574        return false;
     575    }
     576    FindClose( hFind );
     577
     578    return true;
     579}
     580
     581bool IsExistDirectory( const char *DirPath ){
     582    WIN32_FIND_DATA wfd;
     583    HANDLE hFind;
     584
     585    hFind = FindFirstFile(DirPath,&wfd);
     586    if( hFind == INVALID_HANDLE_VALUE ){
     587        //存在しない
     588        return false;
     589    }
     590    FindClose( hFind );
     591
     592    if( wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ){
     593        //ディレクトリの場合
     594        return true;
     595    }
     596
     597    //存在しない
     598    return false;
     599}
Note: See TracChangeset for help on using the changeset viewer.