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

3)Linux³ÌÐòÉè¼ÆÈëÃÅ

3)Linux³ÌÐòÉè¼ÆÈëÃÅ--Îļþ²Ù×÷
LinuxÏÂÎļþµÄ²Ù×÷
Ç°ÑÔ:
ÎÒÃÇÔÚÕâÒ»½Ú½«ÒªÌÖÂÛlinuxÏÂÎļþ²Ù×÷µÄ¸÷¸öº¯Êý.
ÎļþµÄ´´½¨ºÍ¶Áд
ÎļþµÄ¸÷¸öÊôÐÔ
Ŀ¼ÎļþµÄ²Ù×÷
¹ÜµÀÎļþ
----------------------------------------------------------------------------
----
1¡£ÎļþµÄ´´½¨ºÍ¶Áд
ÎÒ¼ÙÉèÄãÒѾ­ÖªµÀÁ˱ê×¼¼¶µÄÎļþ²Ù×÷µÄ¸÷¸öº¯Êý(fopen,fread,fwriteµÈµÈ).µ±È»
Èç¹ûÄã²»Çå³þµÄ»°Ò²²»Òª×ż±.ÎÒÃÇÌÖÂÛµÄϵͳ¼¶µÄÎļþ²Ù×÷ʵ¼ÊÉÏÊÇΪ±ê×¼¼¶Îļþ²Ù×÷
·þÎñµÄ.
µ±ÎÒÃÇÐèÒª´ò¿ªÒ»¸öÎļþ½øÐжÁд²Ù×÷µÄʱºò,ÎÒÃÇ¿ÉÒÔʹÓÃϵͳµ÷Óú¯Êýopen.ʹÓÃÍê
³ÉÒÔºóÎÒÃǵ÷ÓÃÁíÍâÒ»¸öcloseº¯Êý½øÐйرղÙ×÷.
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
int open(const char *pathname,int flags);
int open(const char *pathname,int flags,mode_t mode);
int close(int fd);
openº¯ÊýÓÐÁ½¸öÐÎʽ.ÆäÖÐpathnameÊÇÎÒÃÇÒª´ò¿ªµÄÎļþÃû(°üº¬Â·¾¶Ãû³Æ,ȱʡÊÇÈÏΪÔÚ
µ±Ç°Â·¾¶ÏÂÃæ).flags¿ÉÒÔÈ¥ÏÂÃæµÄÒ»¸öÖµ»òÕßÊǼ¸¸öÖµµÄ×éºÏ.
O_RDONLY:ÒÔÖ»¶ÁµÄ·½Ê½´ò¿ªÎļþ.
O_WRONLY:ÒÔֻдµÄ·½Ê½´ò¿ªÎļþ.
O_RDWR:ÒÔ¶ÁдµÄ·½Ê½´ò¿ªÎļþ.
O_APPEND:ÒÔ×·¼ÓµÄ·½Ê½´ò¿ªÎļþ.
O_CREAT:´´½¨Ò»¸öÎļþ.
O_EXEC:Èç¹ûʹÓÃÁËO_CREAT¶øÇÒÎļþÒѾ­´æÔÚ,¾Í»á·¢ÉúÒ»¸ö´íÎó.
O_NOBLOCK:ÒÔ·Ç×èÈûµÄ·½Ê½´ò¿ªÒ»¸öÎļþ.
O_TRUNC:Èç¹ûÎļþÒѾ­´æÔÚ,Ôòɾ³ýÎļþµÄÄÚÈÝ.
Ç°ÃæÈý¸ö±êÖ¾Ö»ÄÜʹÓÃÈÎÒâµÄÒ»¸ö.Èç¹ûʹÓÃÁËO_CREATE±êÖ¾,ÄÇôÎÒÃÇҪʹÓÃopenµÄµÚ
¶þÖÖÐÎʽ.»¹ÒªÖ¸¶¨mode±êÖ¾,ÓÃÀ´±íʾÎļþµÄ·ÃÎÊȨÏÞ.mode¿ÉÒÔÊÇÒÔÏÂÇé¿öµÄ×éºÏ.
-----------------------------------------------------------------
S_IRUSR Óû§¿ÉÒÔ¶Á S_IWUSR Óû§¿ÉÒÔд
S_IXUSR Óû§¿ÉÒÔÖ´ÐÐ S_IRWXU Óû§¿ÉÒÔ¶ÁдִÐÐ
-----------------------------------------------------------------
S_IRGRP ×é¿ÉÒÔ¶Á S_IWGRP ×é¿ÉÒÔд
S_IXGRP ×é¿ÉÒÔÖ´ÐÐ S_IRWXG ×é¿ÉÒÔ¶ÁдִÐÐ
-----------------------------------------------------------------
S_IROTH ÆäËûÈË¿ÉÒÔ¶Á S_IWOTH ÆäËûÈË¿ÉÒÔд
S_IXOTH ÆäËûÈË¿ÉÒÔÖ´ÐÐ S_IRWXO ÆäËûÈË¿ÉÒÔ¶ÁдִÐÐ
-----------------------------------------------------------------
S_ISUID ÉèÖÃÓû§Ö´ÐÐID S_ISGID ÉèÖÃ×éµÄÖ´ÐÐID
-----------


Ïà¹ØÎĵµ£º

ÔÚLinuxϲ¿ÊðJDK»·¾³

1. È¥http://java.sun.com/javase/downloads/index.jspÏÂÔØÒ»¸öLinux PlatformµÄJDK¡£
2. ÉÏÔØ
# chmod 755 jdk-6u2-linux-i586-rpm.bin
#   ./jdk-6u2-linux-i586-rpm.bin
3. ³ÌÐò»á×Ô¶¯Éú³ÉÎļþ
    Ö´ÐÐ
    # rpm -ivh jdk-6u11-linux-i586.rpm
4. ÉèÖû·¾³±äÁ¿
  ......

°²×°Vista¡¢linux(Fedora10)¡¢Solaris

1.×¼±¸·ÖÇø
 ÓÉÓÚSolarisºÍVista(µÄÒýµ¼¼ÓÔØ)±ØÐë°²×°ÔÚÖ÷·ÖÇøÉÏ£¬linuxÊÇ¿ÉÒÔ°´ÔÚÀ©Õ¹·ÖÇøÉϵÄ
     ËùÒÔÎÒ°Ñ´ÅÅÌ·Ö³É
 30GÖ÷·ÖÇø£º°²×°Vista
 27GÖ÷·ÖÇø£º±¾À´Òª°²×°FreeBSD(Ò²±ØÐë°²×°ÔÚÖ÷·ÖÇøÉÏ,µ«ÊÇFreeBSD²»Ö§³ÖÎҵĻú×ÓËùÒÔ·ÅÆú)
 135GÀ©Õ¹·ÖÇø£ºÆäÖзֳö40GµÄÂß¼­Å̸ ......

×Ô¼º¼ÇµÄһЩlinux³£Óö«Î÷1

²é¿´ËùÓл·¾³±äÁ¿  printenv
ÉèÖãºexport ±äÁ¿Ãû=±äÁ¿Öµ
ɾ³ý£ºunset ±äÁ¿Ãû
Èç¹ûÄãÏë²é¿´Ä³Ò»¸öÃû³ÆµÄ»·¾³±äÁ¿£¬ÃüÁîÊÇ£ºecho $»·¾³±äÁ¿Ãû£¬±ÈÈ磺
echo $ORACLE_HOME
cat ²é¿´ÃüÁî
source ÉúЧ
vi±à¼­Æ÷
ÏÈ°´esc£¬È»ºóÊäÈë :q! £¬´æÅÌÍ˳öÊäÈë :wq
2¡¢X·½Ê½:
¡¡¡¡(1). vi /etc/services # È·±£xdmcp¶Ë¿ ......

ÉîÈëdz³ö LinuxÉ豸Çý¶¯×èÈûÓë·Ç×èÈû (select poll)


×èÈû²Ù×÷ÊÇÖ¸£¬ÔÚÖ´ÐÐÉ豸²Ù×÷ʱ£¬Èô²»ÄÜ»ñµÃ×ÊÔ´£¬Ôò½ø³Ì¹ÒÆðÖ±µ½Âú×ã¿É²Ù×÷µÄÌõ¼þÔÙ½øÐвÙ×÷¡£·Ç×èÈû²Ù×÷µÄ½ø³ÌÔÚ²»ÄܽøÐÐÉ豸²Ù×÷ʱ£¬²¢²»¹ÒÆð¡£±»¹ÒÆðµÄ½ø³Ì½øÈësleep״̬£¬±»´Óµ÷¶ÈÆ÷µÄÔËÐжÓÁÐÒÆ×ߣ¬Ö±µ½µÈ´ýµÄÌõ¼þ±»Âú×ã¡£
ÔÚLinuxÇý¶¯³ÌÐòÖУ¬ÎÒÃÇ¿ÉÒÔʹÓõȴý¶ÓÁУ¨wait queue£©À´ÊµÏÖ×èÈû²Ù×÷¡£wait queueºÜÔ ......

linux´®¿ÚÓ¦Óÿª·¢

linux´®¿ÚÓ¦Óÿª·¢
2009Äê10ÔÂ20ÈÕ ÐÇÆÚ¶þ 14:16
1¡¢´®¿Ú¸ÅÊö
    Óû§³£¼ûµÄÊý¾ÝͨÐŵĻù±¾·½Ê½ÓÐÁ½ÖÖ£º²¢ÐÐͨÐźʹ®ÐÐͨÐÅ¡£
    ´®ÐÐͨÐÅÊǼÆËã»ú³£ÓõĽӿڣ¬È磺RS-232-C½Ó¿Ú¡£¸Ã±ê×¼¹æ¶¨²ÉÓÃÒ»¸öDB25оÒý½ÅÁ¬½ÓÆ÷»òDB9оÒý½ÅÁ¬½ÓÆ÷¡£Ð¾Æ¬ÄÚ²¿³£¾ßÓÐUART¿ØÖÆÆ÷£¬Æä¿É¹¤×÷ÓÚInterrup ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ