- 论坛徽章:
- 0
|
也就是遍历文件夹么~`我写了个函数给你看下,有没有帮助///
/*********************************************************************************************************************************************************************************
**
** Name: folder_rule_explore( const gchar* parent_dir )
**
** Function: It will call the judge_folder_rule() to work .
**
** Programmer: Lu Mingyeung ( Nanjing Institute Of technology | (0)13851807025 )
**
** LastModify: 2008-09-26
***** *****
***** *****
************************************************************************************************************************************************************************************/
static gboolean
folder_rule_explore( const gchar* parent_dir )
{
GDir *dir = g_dir_open(parent_dir,0,NULL);
const gchar * dir_name,*full_name;
while(dir_name = g_dir_read_name(dir) ){
full_name = g_build_filename(parent_dir,dir_name,NULL);
if (g_file_test(full_name ,G_FILE_TEST_IS_DIR)){
folder_rule_judge(full_name);
}
}
g_dir_close(dir);
} |
|