基于入门的环境及makefile。

#include<iostream>
#include<Poco/File.h> using namespace std;
using namespace Poco;
int main(){
File *myfile = new File("/home/ygy/work/poco/file/b.txt"); myfile->createFile(); cout<<"canRead():"<<myfile->canRead()<<endl;
cout<<"canWrite():"<<myfile->canWrite()<<endl;
myfile->copyTo("/home/ygy/work/poco/file/bin"); cout<<"end"<<endl;
}

void copyTo(const std::string & path)const; 将该文件复制到某个目录,将文件内容复制到指定文件。

void createDirectories();   创建所有的目录,即使目录的父目录不存在

bool createDirectory();   在已存在的目录下创建目录。

  Returns true if the directory has been created and false if it already exists

bool createFile(); 创建空文件

  Returns true if the file has been created and false if the file already exists

Timestamp created() const;  这个返回类型还不知道怎么显示时间。

  Returns the creation date of the file.

bool exists() const;

Timestamp getLastModified() const;  上次修改时间

FileSize getSize() const;  返回文件字节数,目录是4096

bool isDevice() const;

  Returns true if and only if the file is a device.

bool isDirectory() const;

  Returns true if and only if the file is a directory.

bool isFile() const;

  Returns true if and only if the file is a regular file.

bool isHidden() const;

bool isLink() const;

  Returns true if and only if the file is a symbolic link

void moveTo( const std::string & path);

void list( std::vector < File > & files) const;    获得所有的File对象

void list( std::vector < std::string > & files) const;  获得所有的name

#include<iostream>
#include<Poco/File.h> using namespace std;
using namespace Poco;
int main(){
File *myfile1 = new File("/home/ygy/work/poco/file");
vector<string>files;
vector<File>Files;
myfile1->list(files);
myfile1->list(Files);
cout<<Files.size()<<endl;
for(auto file:files ){
cout<<file<<endl;
}
}

6
main.cpp
bin
a.txt
main.o
Makefile
ddddd

Poco::File的更多相关文章

  1. c++ poco库https调用

    #include "Poco\File.h"#include "Poco\FileStream.h"#include "Poco\Process.h& ...

  2. Poco之ftp获取文件列表以及下载文件

    #include <iostream>#include <string>#include <vector>#include <algorithm>#in ...

  3. POCO文档翻译:POCO C++库入门指南

    内容目录 介绍 Foundation库 XML库 Util库 Net库 将这些东西组合到一起 介绍 POCO C++库是一组开源C++类库的集合,它们简化及加速了用C++来开发以网络功能为核心的可移植 ...

  4. 使用GDB 追踪依赖poco的so程序,core dump文件分析.

    前言 在windows 下 系统核心态程序蓝屏,会产生dump文件. 用户级程序在设置后,程序崩溃也会产生dump文件.以方便开发者用windbg进行分析. so,linux 系统也有一套这样的东东- ...

  5. linux 下cmake 编译 ,调用,调试 poco 1.6.0 小记

    上篇文章 小记了: 关于 Poco::TCPServer框架 (windows 下使用的是 select模型) 学习笔记. http://www.cnblogs.com/bleachli/p/4352 ...

  6. Poco C++库网络模块例子解析2-------HttpServer

    //下面程序取自 Poco 库的Net模块例子----HTTPServer 下面开始解析代码 #include "Poco/Net/HTTPServer.h" //继承自TCPSe ...

  7. Poco之ftp目录切换与创建

    TEMPLATE = app QT += qml quick widgets#LIBS += -lPocoFoundation -lPocoXML -lPocoNetSOURCES += main.c ...

  8. POCO C++ lib开发环境构建

    Welcome Thank you for downloading the POCO C++ Libraries and welcome to the growing community of POC ...

  9. 使用T4模板生成POCO类

    为什么叫T4?因为简写为4个T. T4(Text Template Transformation Toolkit)是微软官方在VisualStudio 2008中开始使用的代码生成引擎.在 Visua ...

随机推荐

  1. fastCMS八大核心对象

    fastCMS内置system对象,该对象包含八大核心对象,应用于不同的操作场景,分别是: 1.system.string 对象(处理字符类操作) 2.system.number 对象(处理数字类操作 ...

  2. 【radio-group、radio】 单选项组件说明

    radio-group组件是包裹radio组件的容器 原型: <radio-group bindchange="[EventHandle]"> <radio .. ...

  3. 【Linux 运维】 Centos7.x 系统修复模式

    一.linux的运行级别: 运行级别就是来确定系统启动时到底启动那个服务. linux默认有7个运行级别: 0 关机 1 单用户模式,用于系统修复 2 不完全的命令模式,不含NFS服务 3 完全的命令 ...

  4. 剑指offer-二叉树中和为某一值的路径24

    题目描述 输入一颗二叉树的跟节点和一个整数,打印出二叉树中结点值的和为输入整数的所有路径.路径定义为从树的根结点开始往下一直到叶结点所经过的结点形成一条路径.(注意: 在返回值的list中,数组长度大 ...

  5. 3D动态人脸识别技术分析——世纪晟人脸识别实现三维人脸建模

    - 目录 - 国内3D动态人脸识别现状概况 - 新形势下人脸识别技术发展潜力 - 基于深度学习的3D动态人脸识别技术分析 1. 非线性数据建模方法 2. 基于3D变形模型的人脸建模 - 案例结合——世 ...

  6. UVa 340 - Master-Mind Hints 解题报告 - C语言

    1.题目大意 比较给定序列和用户猜想的序列,统计有多少数字位置正确(x),有多少数字在两个序列中都出现过(y)但位置不对. 2.思路 这题自己思考的思路跟书上给的思路差不多.第一个小问题——位置正确的 ...

  7. nodejs笔记--express篇(五)

    创建一个express + ejs的项目 express -e testEjsWebApp cd testEjsWebApp npm install http://localhost:3000 Usa ...

  8. NFC学习总结

    NFC 学习总结 1.NFC 的基本概念 NFC 是 Near FieldCommunication 的缩写,即距离无线通信技术.由飞利浦公司和索尼公司共同开发的NFC 是一种非接触式识别和互联技术, ...

  9. 适合初学者的嵌入式Linux计划

    俗话说万事开头难,刚开始的时候,你是否根本就不知如何开始,上网查资料被一堆堆新名词搞的找不到北,去图书馆看书也是找不到方向?又是arm,又是linux,又是uboot头都大了,不知道自己究竟从哪里开始 ...

  10. “Hello world!”团队—团队选题展示(视频展示说明)

    本次博客的主要内容基本分为以下两方面: 一.视频截图展示 二.视频简要说明 博客内容展示: 视频截图1: 简要说明:这是组长在视频前期简要介绍我们这款游戏项目的内容.从可行性和需求市场方面进行了简要阐 ...