Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux c ¶ÁÈ¡ÎļþÐÐÊý

linux c ¶ÁÈ¡ÎļþÐÐÊý²ÎÕÕwc ϵͳÃüÁî±àдµÄº¯ÊýÈçÏ£º
#include <fcntl.h>
#include <stdlib.h>
#define MAXBSIZE 65536
u_long file_wc(char *file)
{
register u_char *p;
register short gotsp;
register int ch, len;
register u_long linect, charct;
int fd;
u_char buf[MAXBSIZE];
if (file) {
if ((fd = open(file, O_RDONLY, 0)) < 0)
return -1;
for (gotsp = 1; len = read(fd, buf, MAXBSIZE);) {
if (len == -1)
return -1;
charct += len;
for (p = buf; len--;) {
ch = *p++;
if (ch == '\n')
++linect;
if (isspace(ch))
gotsp = 1;
else if (gotsp) {
gotsp = 0;
}
}
}
}
return linect;
}
²âÊÔc
#include <stdlib.h>
int main(int argc,char *argv[])
{
u_long row;
row= file_wc("test.unl");
printf("%d\n",row);
return 0;
}


Ïà¹ØÎĵµ£º

LinuxÏÂperlÄ£¿éµÄ°²×°

ÏȲο´Ò»ÏÂĿ¼ÏµÄREADMEÎĵµ
Ö÷ÒªÓÐÒÔϼ¸¸ö²½Ö裺
1) perl **.PL  Éú³Émakefile Îļþ
2) make
3) make test (this is optional£¬Èç¹ûÕⲽûɶÎÊÌâ,»áÏÔʾһÇÐok)
4) make install
³öÏÖµÄÎÊÌ⣬¶à¿´ÏÂÌáʾ£¬Ò»°ã¶¼ÊÇȱ°üÉÙ¿â ......

Linux °²×°mysql

 
1¡¢¶þ½øÖÆÎļþ£¨tar.gz£©°²×°
ÏÈ´´½¨Óû§ºÍÓû§×é
 su - root
groupadd mysql
useradd -g mysql mysql
½âѹ¶þ½øÖÆÎļþ¡£
gunzip -c filename | tar -xf -
¸´ÖÆĿ¼/home/mysqlµ½/usr/local£»
´´½¨mysqlÐí¿É±í£º
linux:/usr/local/mysql #scripts/mysql_install_db --user=mysql
ÉèÖöþ½øÖÆËùÓÐȨ£¬Ê ......

Oracle Linux Æð動¤ÈÍ£Ö¹¤Î×Ô動»¯

¤½¤ÎËû¤Î¥ª¥Ú¥ìー¥Æ¥£¥ó¥°?¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë¥Çー¥¿¥Ùー¥¹¤ÎÆð動¤ÈÍ£Ö¹¤Î×Ô動»¯
dbstart¤ª¤è¤Ódbshut¥¹¥¯¥ê¥×¥È¤òʹÓ䷤ƥÇー¥¿¥Ùー¥¹¤ÎÆð動¤ÈÍ£Ö¹¤ò×Ô動»¯¤¹¤ë¤Ë¤Ï¡¢´Î¤ÎÊÖ順¤ò実ÐФ·¤Þ¤¹¡£
root¥æー¥¶ー¤Ç¥í¥°¥¤¥ó¤·¤Þ¤¹¡£
¥×¥é¥Ã¥È¥Õ ......

Linux´ÅÅÌ´æ´¢Çø¹ÜÀíµÄÉîÈë½âÎö

Linux´ÅÅÌ´æ´¢Çø¹ÜÀíËãµÄÉÏÒ»¸ö¼¼ÇÉ£¬ºÜ¶àÅóÓÑÔÚÕâÉÏÃæ³£³£ÎÊÎÒ£¬½ñÌìÎҾͰÑÕâ·½ÃæµÄ¶«Î÷»ã×Üһϣ¬´ÓLinuxÌØÓеĽ»»»·ÖÇøµÄÔ­Àí¿ªÊ¼½éÉÜLinux´ÅÅÌ´æ´¢Çø¹ÜÀíµÄÔ­Àí¼°¼¼ÇÉ¡£
Linux´ÅÅÌ´æ´¢Çø¹ÜÀíÔ­Àíƪ
1. ½»»»¿Õ¼äÊÇʲô
Linux ÖÐµÄ ½»»»¿Õ¼ä£¨Swap space£© ÔÚÎïÀíÄڴ棨RAM£©±»³äÂúʱ±»Ê¹Óá£Èç¹ûϵͳÐèÒª¸ü¶àµÄÄÚ´æ×Ê ......

linuxÏÂsocketͨÐÅ֮ͨÐÅÄ£ÐÍ

µ¼¶Á£º
¡¡¡¡1£®Socket¼ò½é
¡¡¡¡SocketÊÇTCP/IPÍøÂçµÄAPI£¬¿ÉÒÔÓÃËüÀ´¿ª·¢ÍøÂçÓ¦ÓóÌÐò£¬SocketÊý¾Ý´«ÊäÊÇÒ»ÖÖÌØÊâµÄI/O£¬SocketÒ²ÊÇÒ»ÖÖÎļþÃèÊö·û
¡¡¡¡2£®SocketµÄ½¨Á¢
¡¡¡¡int socket(int domain£¬ int type£¬ int protocol)
¡¡¡¡º¯Êý·µ»Ø£ºÒ»¸öÕûÐ͵ÄSocketÃèÊö·û£¬¿ÉÒÔÔÚºóÃæµ÷ÓÃËü¡£
¡¡¡¡²ÎÊý˵Ã÷£º
¡¡¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ