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

LINUXÆÚÄ©¸´Ï° Îļþ´¦Àí

Ò»¡¢LINUXÎļþ½á¹¹ ¢ÙÎļþ
  Ϊ²Ù×÷ϵͳ·þÎñ¡¢É豸·ÃÎÊÌṩÁ˼òµ¥¶øͳһµÄ½Ó¿Ú¡£ÎļþÊý¾Ý½á¹¹°üÀ¨ÎļþÃû×Ö¡¢´´½¨ÈÕÆÚ¡¢·ÃÎÊȨ¡¢Îļþ³¤¶ÈµÈ£¬ÕâЩÊý¾Ý¶¼±£´æÔÚÎÒÃdzÆ֮Ϊ ½Úµã ÖС£
¢ÚÉ豸
  Ó²¼þÔÚLINUX/UNIXÖÐͨ³£ÊDZ»Ó³Éä³ÉÎļþµÄ£¬ÕâÔÚǶÈëʽµ±ÖÐÊÇÊ®·ÖÖØÒªµÄ¡£
  ¼¸¸öÖØÒªµÄÉ豸Îļþ£º
  one: /dev/console ´ú±íµÄÊÇϵͳ¿ØÖÆ̨¡£
  two: /dev/tty Êǽø³Ì¿ØÖÆÖնˡ£
  three: /dev/null ¿ÕÉ豸¡£
¢ÛĿ¼
  Ò»ÖÖ±£´æ½ÚµãºÅºÍÆäËûÎļþÃû×ÖµÄÌØÊâÎļþ,ͨ³£Ö»ÄÜÍϹýopendir ºÍ readdirÀ´²Ù×÷¡£ ¶þ¡¢ÏµÍ³µ÷Óà ¶¨Ò壺¶ÔÎļþºÍÉ豸½øÐзÃÎʺͿØÖƵĺ¯Êýµ÷Óñ»³ÆΪϵͳµ÷Óã¬ËüÓÐLINUXÖ±½ÓÌṩ£¬ÊÇͨÏò²Ù×÷ϵͳ±¾ÉíµÄ²Ù×÷½Ó¿Ú¡£
²»×㣺ϵͳµ÷ÓûήµÍ¼ÆËã»úµÄÖ´ÐÐÐÔÄÜ¡£ÒòΪÓû§¿Õ¼äºÍÄں˿ռ䴦ÓÚ²»Í¬µÄ¿Õ¼ä£¬ÏµÍ³µ÷ÓûáÔÚÓû§³ÌÐòºÍÄں˴úÂëÖ®¼äÀ´»ØÇл»£¬ÏµÍ³¿ªÏúºÜ´ó¡£Ò»°ãÓɿ⺯ÊýÀ´¼ä½Óµ÷Óᣠ¢Ùopen

¾ÙÀý£ºfile = open("stu.info ", O_RDWR|O_CREAT, S_IRUSR|S_IWUSR);
˵Ã÷£º O_RDWR£ºÒÔ¶Áд·½Ê½´ò¿ªÎļþ¡£
         O_CREAT£º°´modeÖиøµÄ·ÃÎÊģʽ´´½¨Îļþ¡£
          S_IRUSR£ºÎļþµÄÊôÖ÷Óû§ÓжÁȨÏÞ
          S_IWUSR£ºÎļþµÄÊôÖ÷Óû§ÓÐдȨÏÞ ¢Úclose
¾ÙÀý£ºclose(¾ßÌåµÄÎļþÃèÊö·û); ¢Ûread

¾ÙÀý1£º
char bud[20];
printf(¡°The value read returned %d .\n¡±,res=read(0,buf,20));//±ê×¼ÊäÈë
buf[res]=¡¯\0¡¯;
printf(¡°%s¡±,buf);
¾ÙÀý2£º
typedef struct
{
char stu_num[12];
char name[10];
short int sex;//for 0 is female ,1 is male
char mobile_phone[12];
} stu_info;
read(file,&record,sizeof(record)); ¢Üwrite
  ¾ÙÀý1£º
if(write(1,¡±hellloworld\n¡±,sizeof(¡°hellloworld\n¡±)) != sizeof(¡°hellloworld\n¡±))
    printf(¡°Error!¡±);//±ê×¼Êä³ö
¾ÙÀý2£º
write(file,&record,sizeof(record)); ¢Ýioctl(ǶÈëʽLINUX¶ÔÉ豸µÄÅäÖÃ)
¢Þlseek
¢ßĿ¼Ïà¹Øº¯Êý

Ë


Ïà¹ØÎĵµ£º

LinuxÉ豸ģÐÍÖ®input×ÓϵͳÏê½â

Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......

»ùÓÚARMµÄǶÈëʽlinux Äں˵IJüôÓëÒÆÖ²


0 ÒýÑÔ
   
΢´¦ÀíÆ÷µÄ²úÉúΪ¼Û¸ñµÍÁ®¡¢½á¹¹Ð¡ÇɵÄCPUºÍÍâÉèµÄÁ¬
½ÓÌṩÁËÎȶ¨¿É¿¿µÄÓ²¼þ¼Ü¹¹£¬ÕâÑù£¬ÏÞÖÆǶÈëʽϵͳ·¢Õ¹µÄÆ¿¾±¾ÍÍ»³ö±íÏÖÔÚÁËÈí¼þ·½Ãæ¡£¾¡¹Ü´Ó°ËÊ®Äê´úÄ©¿ªÊ¼£¬ÒѾ­Â½Ðø³öÏÖÁËһЩǶÈëʽ²Ù×÷ϵͳ(±È½ÏÖø
ÃûµÄÓÐVxwork¡¢pSOS¡¢NeculeusºÍWindows
CE)¡£µ«ÕâЩרÓòÙ×÷ϵͳ¶¼ÊÇÉÌ ......

linuxÏÂÅúÁ¿½¨Ä¿Â¼

1£ºlinuxÏÂÅúÁ¿½«´óдĿ¼»òÎļþÃû¸ÄΪСдÃüÁî
ZIP ÏÈ´ò³É°ü£¬ZIP -r A  A/*£¬ÔÙUNZIP -LL    A     B            (A/*±íʾAĿ¼ÏµÄËùÓÐÎļþ)£¨AºÍB¶¼Îª.zipÎļþ,-LL ±ä´óдΪСдµÄ²ÎÊý£©
Ôò£¬A°üÀïµÄ´óдĿ¼ºÍÎļþ ......

ʵÏÖLinuxϵͳµ÷ÓýٳÖ

¹ØÓÚϵͳµ÷ÓýٳÖ
Èç¹ûÒ»¸öľÂíÒªÒþ²ØÆðÀ´£¬²»±»ÏµÍ³¹ÜÀíÔ±·¢ÏÖ¡£½Ø»ñϵͳµ÷ÓÃËƺõÊDZØÐëµÄ¡£´ó²¿·ÖÇé¿öÏ£¬Í¨¹ýÐÞ¸Äϵͳµ÷ÓñíÀ´ÊµÏÖϵͳµ÷ÓõĽٳ֡£ÏÂÃæÊÇÒ»¸öµäÐ͵Ľػñϵͳµ÷ÓõÄÄ£¿é£º
Ä£¿éÒ»£º
#include
#include
#include
#include
#include
#include
#include
#include
#include
MODULE_LICE ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ