linux C ¶ÁȡĿ¼Îļþ²¢Í³¼ÆÎļþÊý
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <errno.h>
#include <string.h>
#define MAX 1024
int get_file_count(char *root)
{
DIR *dir;
struct dirent * ptr;
int total = 0;
char path[MAX];
dir = opendir(root); /* ´ò¿ªÄ¿Â¼*/
if(dir == NULL)
{
perror("fail to open dir");
exit(1);
}
errno = 0;
while((ptr = readdir(dir)) != NULL)
{
//˳Ðò¶Áȡÿһ¸öĿ¼Ï
//Ìø¹ý“..”ºÍ“.”Á½¸öĿ¼
if(strcmp(ptr->d_name,".") == 0 || strcmp(ptr->d_name,"..") == 0)
{
continue;
}
//printf("%s%s\n",root,ptr->d_name);
//Èç¹ûÊÇĿ¼£¬ÔòµÝ¹éµ÷Óà get_file_countº¯Êý
if(ptr->d_type == DT_DIR)
{
sprintf(path,"%s%s/",root,ptr->d_name);
//printf("%s\n",path);
total += get_file_count(path);
}
if(ptr->d_type == DT_REG)
{
total++;
printf("%s%s\n",root,ptr->d_name);
}
}
if(errno != 0)
{
printf("fail to read dir"); //ʧ°ÜÔòÊä³öÌáʾÐÅÏ¢
exit(1);
}
closedir(dir);
return total;
}
int main(int argc, char * argv[])
{
int total;
if(argc != 2)
{
printf("wrong usage\n");
exit(1);
}
total = get_file_count(argv[1]);
printf("%s ha %d files\n",argv[1],total);
return 0;
}
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸еģ¬»î»î»î£¡
&n ......
Linux ÄÚºËÆô¶¯·ÖÎö£¨×ª£©
Linux ÄÚºËÆô¶¯·ÖÎö
1. ÄÚºËÆô¶¯µØÖ·
1.1. Ãû´Ê½âÊÍ
ZTEXTADDR
½âѹ´úÂëÔËÐеĿªÊ¼µØÖ·¡£Ã»ÓÐÎïÀíµØÖ·ºÍÐéÄâµØÖ·Ö®·Ö£¬ÒòΪ´ËʱMMU´¦ÓڹرÕ״̬¡£Õâ¸öµØÖ·²»Ò»¶¨Ê±RAMµÄµØÖ·£¬¿ÉÒÔÊÇÖ§³Ö¶ÁдѰַµÄflashµÈ´æ´¢Öн顣
Start address of ......
linuxÔ¶³Ì¸´ÖÆ linuxÔ¶³Ì¿½±´
Ô¶³ÌÉÏ´«Îļþ¼Ð
¾ÙÀý£¬
ÎÒÒª½«±¾µØÎļþ¼Ð/home/administrator/Desktop/old/driver/test/
Ô¶³ÌÉÏ´«µ½ 192.168.62.10 Õą̂»úÆ÷µÄ/root/Îļþ¼ÐÏ£¬Ê¹ÓÃÔ¶³Ì¶ËµÄrootÓû§×÷ΪµÇ½Óû§
scp -r /home/administrator/Desktop/old/driver/test/ root@192.168.62.10:/root/
Ô¶³ÌÉÏ´«Îļþ¼Ð
¾ÙÀ ......
linuxÄÚºËinit½ø³Ìº¯ÊýµÄ²¿·Ö´úÂëÈçÏ£º 01 if (execute_command)
02 run_init_process(execute_command);
03
04 run_init_process("/sbin/init");
05 run_init_process("/etc/init");
06 run_init_process("/bin/init");
07 run_init_process("/ ......