linux统计有文件个数。
来源:互联网 发布:数据泄漏防护 编辑:程序博客网 时间:2024/05/22 14:20
#include<iostream>
#include<cstdlib>
#include<string>
#include<cstring>
#include<fstream>
using namespace std;
int main(int argc, char* argv[])
{
for (int i = 0; i<argc; i++)
cout<<argv[i]<<endl;
cout << "mysh# ";
cout<<"input filename"<<endl;
string filename;
cin>>filename;
string cmd="du -k "+filename+">xiaojiba.txt";
system(const_cast<char*>(cmd.c_str()));
int count=0;
string temp;
string filelocate=filename+"/xiaojiba.txt";
cout<<filelocate<<endl;
ifstream infile(filelocate.c_str());
while(infile >> temp)
{
count++;
cout<<temp<<endl;
}
cout<<"the number of file is: "<<(count-1)/2<<endl;
cout << "\n";
return 0;
}
#include<cstdlib>
#include<string>
#include<cstring>
#include<fstream>
using namespace std;
int main(int argc, char* argv[])
{
for (int i = 0; i<argc; i++)
cout<<argv[i]<<endl;
cout << "mysh# ";
cout<<"input filename"<<endl;
string filename;
cin>>filename;
string cmd="du -k "+filename+">xiaojiba.txt";
system(const_cast<char*>(cmd.c_str()));
int count=0;
string temp;
string filelocate=filename+"/xiaojiba.txt";
cout<<filelocate<<endl;
ifstream infile(filelocate.c_str());
while(infile >> temp)
{
count++;
cout<<temp<<endl;
}
cout<<"the number of file is: "<<(count-1)/2<<endl;
cout << "\n";
return 0;
}
- linux统计有文件个数。
- linux统计文件个数
- linux统计文件个数
- linux命令---统计文件个数
- linux 下统计文件个数
- linux 统计文件 文件夹个数
- linux 统计文件的个数
- linux统计文件、文件目录个数
- Linux统计文件目录及其文件个数
- Linux统计文件、目录个数,文件行数
- linux统计当前文件个数命令
- Linux统计目录下的文件个数
- linux shell 统计passwd文件shell个数
- Linux 统计目录及其子目录文件个数
- Linux 统计文件/文件夹的个数
- linux 统计文件夹下目录、文件个数
- Linux 统计当前文件/目录个数
- Linux常用命令——统计文件个数
- Tomcat源码分析(四)------ Request和Response处理的全过程
- 如何保证架构设计的稳定性------项目前后两次架构设计对比
- 基于Spring AOP实现对外接口的耗时监控
- 【MFC】用ontimer来解决对话框开始后的一些动作
- 听完蔡学镛的分享《不瞌睡的PPT制作秘诀》后的总结
- linux统计有文件个数。
- 随机算法
- HDFS+MapReduce+Hive+HBase十分钟快速入门
- 【编程】【MFC】面向对象静态函数和静态变量做全局函数
- 关于nio和tomcat6的一些有用图示
- hdu 2639 Bone Collector II (0/1背包)
- 关于C3P0容错和自动重连特性的研究
- 一种封装多种实现的RPC设计
- uestc oj 1081 统计上机成绩