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

Linux C ²Î¿¼ÊÖ²á Ö® »·¾³±äÁ¿Æª

getenv£¨È¡µÃ»·¾³±äÁ¿ÄÚÈÝ£©
Ïà¹Øº¯Êý putenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include<stdlib.h>
¶¨Ò庯Êý char * getenv(const char *name);
º¯Êý˵Ã÷ getenv()ÓÃÀ´È¡µÃ²ÎÊýname»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýnameΪ»·¾³±äÁ¿µÄÃû³Æ£¬Èç¹û¸Ã±äÁ¿´æÔÚÔò»á·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õë¡£»·¾³±äÁ¿µÄ¸ñʽΪname£½value¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õ룬ÕÒ²»µ½·ûºÏµÄ»·¾³±äÁ¿Ãû³ÆÔò·µ»ØNULL¡£
·¶Àý #include<stdlib.h>
mian()
{
char *p;
if((p = getenv(“USER”)))
printf(“USER=%s\n”,p);
}
Ö´ÐÐ USER = root
¡¡
putenv£¨¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿£©
Ïà¹Øº¯Êý getenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include4<stdlib.h>
¶¨Ò庯Êý int putenv(const char * string);
º¯Êý˵Ã÷ putenv()ÓÃÀ´¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýstringµÄ¸ñʽΪname£½value£¬Èç¹û¸Ã»·¾³±äÁ¿Ô­ÏÈ´æÔÚ£¬Ôò±äÁ¿ÄÚÈÝ»áÒÀ²ÎÊýstring¸Ä±ä£¬·ñÔò´Ë²ÎÊýÄÚÈÝ»á³ÉΪÐµĻ·¾³±äÁ¿¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»Ø0£¬ÓдíÎó·¢ÉúÔò·µ»Ø-1¡£
´íÎó´úÂë ENOMEM ÄÚ´æ²»×㣬ÎÞ·¨ÅäÖÃÐµĻ·¾³±äÁ¿¿Õ¼ä¡£
·¶Àý #include<stdlib.h>
main()
{
char *p;
if((p = getenv(“USER”)))
printf(“USER =%s\n”,p);
putenv(“USER=test”);
printf(“USER+5s\n”,getenv(“USER”));
}
Ö´ÐÐ USER=root
USER=root
¡¡
setenv£¨¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿£©
Ïà¹Øº¯Êý getenv£¬putenv£¬unsetenv
±íÍ·Îļþ #include<stdlib.h>
¶¨Ò庯Êý int setenv(const char *name,const char * value,int overwrite);
º¯Êý˵Ã÷ setenv()ÓÃÀ´¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýnameΪ»·¾³±äÁ¿Ãû³Æ×Ö·û´®¡£
²ÎÊý valueÔòΪ±äÁ¿ÄÚÈÝ£¬²ÎÊýoverwriteÓÃÀ´¾ö¶¨ÊÇ·ñÒª¸Ä±äÒÑ´æÔڵĻ·¾³±äÁ¿¡£Èç¹ûoverwrite²»Îª0£¬¶ø¸Ã»·¾³±äÁ¿Ô­ÒÑÓÐÄÚÈÝ£¬ÔòÔ­ÄÚÈݻᱻ¸ÄΪ²ÎÊývalueËùÖ¸µÄ±äÁ¿ÄÚÈÝ¡£Èç¹ûoverwriteΪ0£¬ÇҸû·¾³±äÁ¿ÒÑÓÐÄÚÈÝ£¬Ôò²ÎÊývalue»á±»ºöÂÔ¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»Ø0£¬ÓдíÎó·¢Éúʱ·µ»Ø-1¡£
´íÎó´úÂë ENOMEM ÄÚ´æ²»×㣬ÎÞ·¨ÅäÖÃÐµĻ·¾³±äÁ¿¿Õ¼ä
·¶Àý #include<stdlib.h>
main()
{
char * p;
if((p=getenv(“USER”)))
printf(“USER =%s\n”,p);
setenv(“USER”,”test”,1);
printf(“USER=%s\n”,getenv(“USEr”));
unse


Ïà¹ØÎĵµ£º

ÈçºÎʹÓ÷ºÐÍÄ£擬virtual? (C/C++) (template)

ÍøÉÏÒ»µÀ½ðɽµÄÃæÊÔÌ⣺
http://topic.csdn.net/u/20100524/14/0eff992a-2849-4db6-bdaa-d4a200e79b7c.html
Çë·Ö±ðÓÃC++µÄÃæÏò¶ÔÏóºÍ·ºÐÍ»úÖÆ£¬±àдʵÏÖTemplate MethodģʽµÄʾÀý´úÂ룬²¢±È½ÏÁ½ÖÖ·½Ê½¸÷×ÔµÄÓÅȱµã¡£
ÓÃÐ麯ÊýʵÏÖTemplate MethodµÄ·½Ê½¾Í²»¶à˵ÁË¡£Ó÷ºÐ͵ķ½Ê½ÊµÏÖ¶à̬ÔÚATLÀïÃæÓдóÁ¿µÄÓõ½£¡
·ºÐ͵ ......

»ùÓÚǶÈëʽLinuxµÄÊÓÆµÍ¼Ïñ²É¼¯Óë´«Êä

 
ÕªÒª:ÊÓÆµÍ¼Ïñ²É¼¯¼°´¦Àí¼¼ÊõÔÚÔ¶³ÌÊÓÆµ¼à¿ØºÍ¿ÉÊӵ绰ÖÐÓÐ׏㷺µÄÓ¦ÓÃǰ¾°£¬Çý¶¯ÊÓÆµ²É¼¯É豸ºÍ»ñÈ¡ÊÓÆµÊý¾Ý²¢½øÐÐÏàÓ¦µÄ´¦Àí£¬ÊÇʵÏÖÕâЩӦÓõĻù´¡¡£Õë¶ÔÕâЩӦÓ㬹¹½¨ÁËÒ»¸ö»ùÓÚǶÈëʽ LinuxºÍ PXA270΢´¦ÀíÆ÷µÄÊÓÆµ²É¼¯Óë´«Êäϵͳ£¬ÀûÓà Video4LinuxʵÏÖ USBÉãÏñÍ·ÊÓÆµÊý¾Ý²É¼¯£¬²É¼¯µÄÊÓÆµÊý¾Ý¾­ JPEGѹËõº ......

LinuxÖÐerrnoʹÓÃ

µ±linuxÖеÄC apiº¯Êý·¢ÉúÒ쳣ʱ,Ò»°ã»á½«errno±äÁ¿(Ðèinclude
errno.h)¸³Ò»¸öÕûÊýÖµ,²»Í¬µÄÖµ±íʾ²»Í¬µÄº¬Òå,¿ÉÒÔͨ¹ý²é¿´¸ÃÖµÍÆ²â³ö´íµÄÔ­Òò£¬ÔÚʵ¼Ê±à³ÌÖÐÓÃÕâÒ»Õнâ¾öÁ˲»ÉÙÔ­±¾¿´À´ÄªÃûÆäÃîµÄÎÊÌâ¡£µ«ÊÇ
errnoÊÇÒ»¸öÊý×Ö£¬´ú±íµÄ¾ßÌ庬Ò廹Ҫµ½errno.hÖÐÈ¥ÔĶÁºê¶¨Ò壬¶øÃ¿´Î²éÔÄÊÇÒ»¼þºÜ·±ËöµÄÊÂÇé¡£ÓÐÏÂÃæ¼¸ÖÖ·½·¨ ......

LinuxÏÂTomcat 6.0.26 °²×°

ÎÒÓõÄÊÇ fedora 12 ×Ô´ýµÄjdk 1.6 ÔÚ /usr/lib/jvm/java-1.6.0-openjdk
µÚÒ»²½£º°Ñapache-tomcat-6.0.26.tar.gz½âѹºó·Åµ½/usr/local/ÏÂÖØÃüÃûΪapache-tomcat-6.0.26
µÚ¶þ²½£ºÔÚ/etc/profileÎļþÖÐÊʵ±µÄλÖÃÌí¼ÓÈçÏ»·¾³±äÁ¿
CATALINA_HOME=/usr/local/apache-tomcat-6.0.26
CATALINA_BASE=/usr/local/apache-tomcat ......

Linux °²×°SVN

ÆäʵLinuxÏÂSVN»¹ÊDZȽϼòµ¥£¬ ÔÚÍøÉÏ£¬ Ò»ËѾÍÊÇÒ»´ó°ÑµÄ×ÊÁÏ¡£ µ«ºÜÉÙÓÐÈËÒ»´Î°²×°³É¹¦£¬ ÒòΪLinuxÖеĻ·¾³Ì«¸´ÔÓ£¬
ºÜÈÝÒ×»·¾³³åÍ»¡£
linux svnÒ»°ãÒÀÀµÓÚhttpd£¨Apache Web·þÎñÆ÷£©.
svn¶ÀÁ¢·½Ê½
µ±È»svn»¹ÓжÀÁ¢·½Ê½£¬ ¼´²»ÐèÒªapache·þÎñÆ÷, ¼´Ìø¹ýÏÂÃæµÄapache°²×°£¬ ¼°ÅäÖÃÖйØÓÚhttpd.conf²¿·Ö¡£
ÔÚ±àÒës ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ