Test Header HTML Code

Unix编程-列出目录下文件列表

 

代码
DIR *dp;
std::
string dir = dataDir;
if(dir.length() > 0 && dir[dir.length() - 1] != '/')
{
dir.push_back(
'/');
}

if(dp = opendir(dataDir.c_str()))
{
struct dirent *dirp;
while(dirp = readdir(dp))
{
std::cout
<< dirp->d_name;
}
}

 

 

posted on 2010-12-23 23:30  宁静的水泡  阅读(256)  评论(0编辑  收藏  举报

导航

Test Rooter HTML Code