• MFC 相关文件夹、文件操作


    //关于文件(夹)操作,可以参考下SHFileOperation这个外壳函数,貌似可以显示进度条。
    以下没有使用SHFileOperation
    //删除一个文件夹下的所有内容
    void myDeleteDirectory(CString directory_path)
    {    
        CFileFind finder; 
        CString path; 
        path.Format("%s/*.*",directory_path); 
        BOOL bWorking = finder.FindFile(path); 
        while(bWorking){ 
            bWorking = finder.FindNextFile(); 
            if(finder.IsDirectory() && !finder.IsDots()){//处理文件夹 
                myDeleteDirectory(finder.GetFilePath()); //递归删除文件夹 
                RemoveDirectory(finder.GetFilePath()); //删除文件夹,只能删除空的文件夹
            } 
            else{//处理文件 
                DeleteFile(finder.GetFilePath());//删除文件
            } 
        } 
    }
    PathIsDirectory(path)//判读path是否为文件夹
    PathFileExists(path)//判读path是否存在
    CreateDirectory(newPath,NULL)//创建一个文件夹
    CopyFile(srcfile,dstfile,false)//复制文件

  • 相关阅读:
    MySQL--字符集参数
    MySQL--字符集基础
    Cassandra基础2
    Cassandra基础
    Cassandra -- Cassandra 3.0版本安装
    Cassandra Demo--Python操作cassandra
    MySQL--批量插入导致自增跳号问题
    MySQL Disk--SSD和HDD的性能
    MySQL Lock--并发插入导致的死锁
    TCL-视图
  • 原文地址:https://www.cnblogs.com/coolbear/p/3458125.html
Copyright © 2020-2023  润新知