C/C++ DIR±éÀúº¯Êý
#include <list.h>
#include <dirent.h>
#include <iostream.h>
#include <sys/stat.h>
#include <sys/types.h>
/*****************************************************************
*º¯Êý¹¦ÄÜ: Ä¿_¼_±é_Àú.
*·µ»ØÖµ: ³É¹¦·µ»Ø0,ʧ°Ü·µ»Ø·Ç0.
*²ÎÊý path : ¿ªÊ¼±éÀúµÄ·¾¶(×îºÃ²»ÒªÊ¹ÓÃÏà¶Ô·¾¶)
* l : ±£´æÕÒµ½Â·¾¶µÄstd:list¶ÔÏó
* field: Òª²éÕÒµÄĿ¼Ãû³Æ.
* Èç: list("/home/wyq/",list,"tmp");
* Ôò¿ÉÒÔÕÒµ½ /home/wyq/*/tmp/
* Èç: list("/home/wyq/",list,"tmp/template");
* Ôò¿ÉÒÔÕÒµ½ /home/wyq/*/tmp/template
*
*****************************************************************/
int listDir(const char *path,list<string> &l,char * field = NULL)
{
using namespace std;
string Path(path);
DIR *pDir ;
struct dirent *ent ;
char childpath[10240];
string childStr;
if ( NULL == path )
{
return -1;
}
if ( '/' != Path[Path.length()-1] )
{
Path.append(1,'/');
}
if ( '/' != Path[0] )
{
Path.insert(0,"/");
}
if ( NULL == ( pDir=opendir(Path.c_str()) ) )
{
return -1;
Ïà¹ØÎĵµ£º
Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸еģ¬»î»î»î£¡
&n ......
¾«¶Ì¸ßЧµÄXML½âÎöÆ÷,´¿Cµ¥Ò»³ÌÐò,Ó¦ÓÃÓÚÒøÐеĹúË°¿âÐкáÏòÁªÍø½Ó¿ÚϵͳÖÐ,Îȶ¨¿É¿¿,ÔËÐÐËٶȷɿì,·ÇÏàÓ¦µÄJAVA³ÌÐò¿É±È.ÒÔÏÂΪ´ó²¿·ÖÔ´Âë:
/* Copyright (c) 2005 wzs */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <varargs.h>
#i ......
C/C++ÄÚ´æÓëÔËÐÐʱÉîÈëÑо¿ [×÷ÕßJean.Love]
-----------------------------------------------------------------------------------
(Ò»)ÕûÊý·ûºÅµÄÏÝÚå
(¶þ)¸¡µãÊýµÄ±¾ÖÊ
(Èý)¶ÑÕ»µÄÄÚ´æ¹ÜÀí½á¹¹
(ËÄ)·ûºÅ½âÎö
(Îå)¶ÔÆëºÍ×ÜÏß´íÎó
(Áù)º¯ÊýÖ¸Õë
(Æß)Ð麯ÊýµÄÊ ......
¸ßÖÊÁ¿C++/C±à³ÌÖ¸ÄÏ
Îļþ״̬
[ ] ²Ý¸åÎļþ
[√] ÕýʽÎļþ
[ ] ¸ü¸ÄÕýʽÎļþ Îļþ±êʶ£º
µ±Ç°°æ±¾£º 1.0
×÷ Õߣº ÁÖÈñ ²©Ê¿
Íê³ÉÈÕÆÚ£º 2001Äê7ÔÂ24ÈÕ
°æ ±¾ Àú Ê·
°æ±¾/״̬ ×÷Õß ²ÎÓëÕß ÆðÖ¹ÈÕÆÚ ±¸×¢
V ......
CRT (C run-time library)
Ò» ²úÉú
ÔËÐÐʱ¿âÊdzÌÐòÔÚÔËÐÐʱËùÐèÒªµÄ¿âÎļþ£¬Í¨³£ÒÔLIB»òDLLÐÎʽÌṩ¡£
CÔËÐÐʱ¿â¾ÍÊÇC run-time library£¬µ®ÉúÓÚ20ÊÀ¼Í70Äê´ú£¬ÊÇC¶ø·ÇC++ÓïÑÔÊÀ½çµÄ¸ÅÄC³ÌÐòÔËÐÐʱÐèÒªÕâЩ¿âÖеĺ¯Êý¡£
C ÓïÑÔÊÇËùνµÄ“СÄں˔ÓïÑÔ£¬¾ÍÆäÓïÑÔ±¾ÉíÀ´ËµºÜС£¨²»¶àµÄ¹Ø¼ü×Ö£¬³ÌÐòÁ÷³Ì¿ØÖÆ£ ......