zoukankan      html  css  js  c++  java
  • 26.boost文件库

     1 #define _CRT_SECURE_NO_WARNINGS
     2 #include <boost/filesystem/operations.hpp>
     3 #include <boost/filesystem.hpp>
     4 #include <iostream>
     5 using namespace std;
     6 using namespace boost;
     7 
     8 
     9 void main()
    10 {
    11     boost::filesystem::directory_iterator begin("C:\");
    12     boost::filesystem::directory_iterator end;
    13 
    14     for (; begin != end; begin++)
    15     {
    16         //文件状态
    17         boost::filesystem::file_status fs = begin->status();
    18 
    19         switch (fs.type())
    20         {
    21         case boost::filesystem::regular_file:
    22             cout << "标准文件" << endl;
    23             break;
    24         case boost::filesystem::symlink_file:
    25             cout << "操作系统文件" << endl;
    26             break;
    27         case boost::filesystem::directory_file:
    28             cout << "文件夹" << endl;
    29             break;
    30         default:
    31             break;
    32         }
    33         cout << begin->path() << endl;
    34     }
    35     cin.get();
    36 }
  • 相关阅读:
    IO模型
    Java NIO概述
    消息系统避免分布式事务
    JVM调优总结
    设计模式的六大原则
    Java 内存区域与内存溢出
    windows go安装
    ZooKeeper原理及使用
    再谈HashMap
    Html5 播放实时音频流
  • 原文地址:https://www.cnblogs.com/xiaochi/p/8691093.html
Copyright © 2011-2022 走看看