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

linux³ÌÐò´ò²»¿ªÍ·Îļþ

#include <fcnt1.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc,char *argv[])
{
  int fd_open,fd_open_create,fd_create;
  if((fd_open=open("/home/wang/test/hello.c",O_RDONLY))==-1)
    {
      perror("open");
      exit(EXIT_FAILURE);
    }
  printf("the file's descriptor is:%d\n",fd_open);

  if((fd_open_create==open("./tmp1",O_CREAT|O_EXCL,0644))==-1)
    {
      perrno("open");
      exit(EXIT_FAILURE);
    }
  printf("the tmp1 file descriptor is:%d\n",fd_open_create);

  if((fd_create=creat("./tem2",0644))==-1)
    {
      perrno("create");
      exit(EXIT_FAILURE);
    }
  printf("the tmp2 file descriptor is:%d\n",fd_create);

  close(fd_open);
  close(fd_create);
  close(fd_open_create);

  return 0;
}
±àÒë½á¹û
wangjun@my-desktop:~/test$ gcc -ggdb3 -o open_example open_example.c
open_example.c:1:19: ´íÎó£º fcnt1.h£ºÃ»ÓиÃÎļþ»òĿ¼
open_example.c: ÔÚº¯Êý¡®main¡¯ÖÐ:
open_example.c:8:


Ïà¹ØÎÊ´ð£º

Ë­Äܸø¸öLinuxÏÂдC/C++³ÌÐòµÄ½Ì³Ì£¿

¸ø¸öµØÖ·£¬»òÕß·¢µ½ÎÒÓÊÏäÒ²ÐÐ wrongagain98@163.com
×îºÃÊÇÊÓƵµÄ£¬²»ÊÇÊÓƵÆÕͨµÄÒ²ÐС£

Ö÷ÒªÊÇÁ½·½Ã棺
1.ÔõÑù±à¼­¡¢±àÒëºÍµ÷ÊÔ³ÌÐò¡£Ï£ÍûÄÜÒ»²½²½½²Çå³þ£¬ÈçºÎ°²×°¡¢ÈçºÎÅäÖõȡ£²»Òª¾Íֻ˵¾ä¡°¾ÍÓ ......

linux»·¾³ÏÂgethostbynameº¯ÊýÎÊÌâ - C/C++ / CÓïÑÔ

дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
   
  struct hostent *hp; 
char AlarmDevIP[20];  
  int x2;

hp = gethostbyname("www.google.com");
if (hp)
{ ......

linux·ÖÇø´íÎó

ÇóÖú~~~~~~~~~~~ÕýÔÚ×°redhat£¬·ÖÇøÀÏÊDz»³É¹¦£¬ÓÐÈËÖªµÀô
ÏÖÔÚÓÖÒ»¸ö5G µÄntfs¸ñʽ¿ÕÅÌ£¬Ôõô×ö°¡
ÔÚÏßµÈ~


ÎÒÏÈɾ³ýÕâ¸ö·ÖÇø£¬È»ºó½¨Á¢Ò»¸ö  /boot  £¨102M£©£¬È»ºóÔÙʣϵĿÕÓà¿Õ¼ä½¨Á ......

ÔõÑùÐÞ¸ÄLinux³ÌÐò

ÎÒÒªÐÞ¸ÄÒ»¸öLinux³ÌÐòÖеÄÒ»¸ö×Ö·û´®£¬Ä¿µÄ´®±ÈÔ­À´µÄ³¤£¬ËùÒÔÖ±½ÓÌæ»»³ÌÐòÎÞ·¨ÔËÐУ¬ÒªÔõô°ì²ÅÄÜʹ³ÌÐòÕý³£ÔËÐУ¿
²»Ã÷°×ÄãÒª¸Éʲô ¸Äʲô³ÌÐò£¿

Ò»¸öÊÖ»úÉϵÄÄ£ÄâÆ÷£¬±¾À´ÊÇÔÚ/mmc/mmca1Ï´´½¨RomsÎļþ¼Ð£¬ ......

linuxÏÂdÊÇʲôÃüÁ



ÕâÀï¿´²»¶®¡£¡£
ÓÐÕâ¸öÃüÁîÂð£¿

type d
ÊÔÊÔ¿´ÊDz»ÊDZðÃû»òÊǺ¯ÊýÃû

ÕâÊÇÔÚcygwinÏÂÔËÐеģ¬»¹ÊÇ¿´²»Ã÷°×¡£
ÊäÈëÁË type d ÒÔºó±ä³ÉÕâÑù£º


¿´²»µ½Í¼Æ¬

ûÓÐÕâ¸öÃüÁÊDz»ÊÇÒ»¸ö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ