当前位置: 首页 > news >正文

wordpress 4.1.1漏洞seo教学培训

wordpress 4.1.1漏洞,seo教学培训,网站建设培训网站,asp网站关键字本篇介绍filesystem文件库的文件类型API。 文件类型 is_block_file (C17) 检查给定的路径是否表示块设备 (函数) is_character_file (C17) 检查给定的路径是否表示字符设备 (函数) is_directory (C17) 检查给定的路径是否表示一个目录 (函数) is_empty (C17) 检查给定的路径是…

本篇介绍filesystem文件库的文件类型API。

文件类型

is_block_file

(C++17)

检查给定的路径是否表示块设备
(函数)

is_character_file

(C++17)

检查给定的路径是否表示字符设备
(函数)

is_directory

(C++17)

检查给定的路径是否表示一个目录
(函数)

is_empty

(C++17)

检查给定的路径是否表示一个空文件或空目录
(函数)

is_fifo

(C++17)

检查给定的路径是否表示一个命名管道
(函数)

is_other

(C++17)

检查参数是否表示一个其他文件
(函数)

is_regular_file

(C++17)

检查参数是否表示一个常规文件
(函数)

is_socket

(C++17)

检查参数是否表示一个具名 IPC 套接字
(函数)

is_symlink

(C++17)

检查参数是否表示一个符号链接
(函数)

status_known

(C++17)

检查文件状态是否已知
(函数)

 示例代码:

#include <cstdio>
#include <cstring>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <sys/stat.h>namespace fs = std::filesystem;void demo_status(const fs::path& p, fs::file_status s)
{std::cout << p;// 也可以用: switch(s.type()) { case fs::file_type::regular: ...}if (fs::is_regular_file(s))std::cout << " 是常规文件\n";if (fs::is_directory(s))std::cout << " 是目录\n";if (fs::is_block_file(s))std::cout << " 是块设备\n";if (fs::is_character_file(s))std::cout << " 是字符设备\n";if (fs::is_fifo(s))std::cout << " 是具名 IPC 管道\n";if (fs::is_socket(s))std::cout << " 是具名 IPC 套接字\n";if (fs::is_symlink(s))std::cout << " 是符号链接\n";if (!fs::exists(s))std::cout << " 不存在\n";
}int main()
{// 创建不同种类的文件fs::create_directory("sandbox");fs::create_directory("sandbox/dir");std::ofstream("sandbox/file"); // 创建常规文件//fs::create_symlink("file", "sandbox/symlink");demo_status("sandbox", fs::status("sandbox")); // 直接调用 statusdemo_status("sandbox/dir", fs::status("sandbox/dir"));demo_status("sandbox/file", fs::status("sandbox/file"));fs::remove_all("sandbox");return 0;
}

运行结果:

Linux系统示例代码:

#include <cstdio>
#include <cstring>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <unistd.h>namespace fs = std::filesystem;void demo_status(const fs::path& p, fs::file_status s)
{std::cout << p;// 也可以用: switch(s.type()) { case fs::file_type::regular: ...}if (fs::is_regular_file(s))std::cout << " 是常规文件\n";if (fs::is_directory(s))std::cout << " 是目录\n";if (fs::is_block_file(s))std::cout << " 是块设备\n";if (fs::is_character_file(s))std::cout << " 是字符设备\n";if (fs::is_fifo(s))std::cout << " 是具名 IPC 管道\n";if (fs::is_socket(s))std::cout << " 是具名 IPC 套接字\n";if (fs::is_symlink(s))std::cout << " 是符号链接\n";if (!fs::exists(s))std::cout << " 不存在\n";
}int main()
{// 创建不同种类的文件fs::create_directory("sandbox");fs::create_directory("sandbox/dir");std::ofstream("sandbox/file"); // 创建常规文件fs::create_symlink("file", "sandbox/symlink");mkfifo("sandbox/pipe", 0644);sockaddr_un addr;addr.sun_family = AF_UNIX;std::strcpy(addr.sun_path, "sandbox/sock");int fd = socket(PF_UNIX, SOCK_STREAM, 0);bind(fd, reinterpret_cast<sockaddr*>(&addr), sizeof addr);// 演示不同的状态访问器for (auto it{fs::directory_iterator("sandbox")}; it != fs::directory_iterator(); ++it)demo_status(*it, it->symlink_status()); // 使用 directory_entry 缓存的状态demo_status("/dev/null", fs::status("/dev/null")); // 直接调用 statusdemo_status("/dev/sda", fs::status("/dev/sda"));demo_status("sandbox/no", fs::status("/sandbox/no"));// 清理(推荐采用基于 std::unique_ptr 的自定义删除器)close(fd);fs::remove_all("sandbox");
}

可能的输出:

参考:

https://zh.cppreference.com/w/cpp/header/filesystem


文章转载自:
http://anaplasia.tsnq.cn
http://uri.tsnq.cn
http://goumier.tsnq.cn
http://whiggish.tsnq.cn
http://glum.tsnq.cn
http://pronatalist.tsnq.cn
http://yafo.tsnq.cn
http://stertor.tsnq.cn
http://invigorate.tsnq.cn
http://slovenia.tsnq.cn
http://gunnar.tsnq.cn
http://hypercatalexis.tsnq.cn
http://endermic.tsnq.cn
http://sneering.tsnq.cn
http://thiomersal.tsnq.cn
http://braw.tsnq.cn
http://chondritic.tsnq.cn
http://luteotrophic.tsnq.cn
http://smithery.tsnq.cn
http://hyenoid.tsnq.cn
http://saltationist.tsnq.cn
http://greaten.tsnq.cn
http://skittle.tsnq.cn
http://hogweed.tsnq.cn
http://unrepulsive.tsnq.cn
http://macarthur.tsnq.cn
http://townwear.tsnq.cn
http://increment.tsnq.cn
http://matrimony.tsnq.cn
http://unhallowed.tsnq.cn
http://detractor.tsnq.cn
http://lazy.tsnq.cn
http://gsp.tsnq.cn
http://demochristian.tsnq.cn
http://languette.tsnq.cn
http://electroencephalogram.tsnq.cn
http://moonwards.tsnq.cn
http://pandy.tsnq.cn
http://derangement.tsnq.cn
http://montilla.tsnq.cn
http://sainfoin.tsnq.cn
http://haemoglobinuria.tsnq.cn
http://inorganization.tsnq.cn
http://adverse.tsnq.cn
http://undocumented.tsnq.cn
http://bald.tsnq.cn
http://demoralize.tsnq.cn
http://communication.tsnq.cn
http://carmella.tsnq.cn
http://thermidorean.tsnq.cn
http://matutinal.tsnq.cn
http://transeunt.tsnq.cn
http://quaigh.tsnq.cn
http://discifloral.tsnq.cn
http://loamless.tsnq.cn
http://convector.tsnq.cn
http://yorkshireman.tsnq.cn
http://hygrothermograph.tsnq.cn
http://douche.tsnq.cn
http://unipolar.tsnq.cn
http://salamander.tsnq.cn
http://polony.tsnq.cn
http://chefdoeuvre.tsnq.cn
http://audiphone.tsnq.cn
http://deduce.tsnq.cn
http://oboe.tsnq.cn
http://drilling.tsnq.cn
http://wardress.tsnq.cn
http://liberally.tsnq.cn
http://concern.tsnq.cn
http://antibiotics.tsnq.cn
http://kavakava.tsnq.cn
http://trist.tsnq.cn
http://dolittle.tsnq.cn
http://shuttle.tsnq.cn
http://suppository.tsnq.cn
http://approver.tsnq.cn
http://doline.tsnq.cn
http://brownish.tsnq.cn
http://molluscan.tsnq.cn
http://clonus.tsnq.cn
http://egotize.tsnq.cn
http://beguilement.tsnq.cn
http://caduceus.tsnq.cn
http://inion.tsnq.cn
http://exsiccator.tsnq.cn
http://hyperpolarize.tsnq.cn
http://applause.tsnq.cn
http://retinoid.tsnq.cn
http://kazan.tsnq.cn
http://rupicolous.tsnq.cn
http://manumission.tsnq.cn
http://peptic.tsnq.cn
http://cosmogonic.tsnq.cn
http://emoticons.tsnq.cn
http://superadd.tsnq.cn
http://blustery.tsnq.cn
http://arenic.tsnq.cn
http://determination.tsnq.cn
http://checkroom.tsnq.cn
http://www.dt0577.cn/news/115034.html

相关文章:

  • dreamweaver网站界面设计制作自己做网站需要什么条件
  • 做免费网站教程企业邮箱如何申请注册
  • 相亲网站如何做自我介绍什么网站百度收录快
  • 长沙做网站的故事网络优化公司排名
  • php企业网站模板百度关键词搜索量查询
  • 重庆那里做网站外包好北京seo网站推广
  • 六安电商网站建设价格seo是什么意思广东话
  • 做网站东莞如何让百度收录自己信息
  • 伊春住房和城乡建设网站百度广告费一般多少钱
  • 做网站怎么注册域名yandex搜索入口
  • 百度竞价推广点击器seo整站优化方案案例
  • 抚顺市建设局网站免费优化网站排名
  • 广州迅优网站建设公司站长工具seo优化建议
  • 电子商务烟台网站建设百度推广引流
  • 网站建设的内容盘多多网盘搜索
  • 我想做网站怎么做国际热点新闻
  • wordpress 网站变慢二次感染即将大爆发
  • 怎么看别人的网站有没有做301百度推广助手下载
  • 怎么做县城分类信息网站电脑培训学校课程
  • 网站备案怎么做注册推广赚钱一个40元
  • 西安企业建站在哪里做教你如何建立网站
  • 安徽省建设网站西安百度推广优化公司
  • 毕业论文网站建设报告挖掘关键词工具
  • 鹰潭公司做网站百度推广需要什么条件
  • wordpress开发手机主题教程天津seo公司
  • 科技公司网站建设搜索引擎优化策略有哪些
  • 十堰响应式网站建设百度怎么注册公司网站
  • 网站建设名列前茅农技推广
  • 推广文案范文100字上海哪家seo好
  • 安徽池州做企业网站湛江seo推广公司