linux ,±àдһ¸ö³ÌÐò,°ÑÒ»¸öÎļþ¸´ÖƵ½ÁíÒ»¸öÎļþÉÏ
¼´ÊµÏÖ¼òµ¥µÄcopy¹¦ÄÜ
ÒªÇó:Ö»Óà open() read() write() ºÍclose()ϵͳµ÷ÓÃ.
cat file1 >> file2 £¿
open()Á¬¸öÎļþ£¬read()ÆäÖÐÒ»¸öÄÚÈÝ£¬write()µ½ÁíÍâÒ»¸öÎļþÉÏ£¬×îºóclose()µô¡£
Äܲ»ÄÜÓÃlseekº¯Êý£¿
C/C++ code:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define BUF_SIZE 1024*8
int main()
{
int fds, fdd;
char buf[BUF_SIZE];
size_t hasread = 0;
fds = open("filea", O_RDONLY);
fdd = open("fileb", O_WRONLY, O_CREAT);
if(fds && fdd)
{
while((hasread = read(fds, buf, sizeof(buf))) > 0)
{
write(fdd, buf, hasread);
}
close(fds);
close(fdd);
}
²»ºÃÒâ˼£¬ÉÙcopy°ë±ß¡°}¡±
·Ç³£ºÃ
Ïà¹ØÎÊ´ð£º
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
СµÜ×î½üÐèÒªÒ»¸öÓÃsocket»ñÈ¡htmlÎĵµµÄ´úÂ룬µ«ÊÇÀÏÊDz»ÄÜ»ñÈ¡ÍêÕûµÄhtmlÔ´Âë¡£ÔÒò²»Ã÷£¬Íû¸ßÊÖÖ¸µã£¡
C/C++ code:
char *Http_GET(char *host,int port,char *data) //·¢ËÍGETÇëÇó
{
char response[2 ......
ÎÒÖ®Ç°ÖÆ×÷µÄlinux×Ô¶¯°²×°isoÒѾ³É¹¦ÁË£¬ÏÖÔÚÏë¶ÔÆä½øÐÐһЩ¶¨ÖÆÐ޸쬱ÈÈ磬¸ü¸ÄgrubͼƬµÈ¡£
ÎÒÔÚks.cfgµÄ%post¶ÎÀïÃæÊÇÕâÑùдµÄ£º
%post --nochroot
# Move the contents of the tar into their new locati ......
ÎÒÔÚLINUXÉÏÓÐÁ½¸öÓû§
Ò» root
¶þ myadmin
¡¾myadmin@localhost~¡¿$ dir
Desktop myphp
[myadminlocalhost~]$ cd myphp¡¢DesktopÄܽøÈ¥ÆäËûµÄϵͳĿ¼½ø²»È¥
Ö»ÓÐÕâÁ½¸öĿ¼ ÎÒÏë½øÈëÆäËûµÄÏ ......
RT
javaµÄһЩ½çÃæÊÇ·½¿é¡£Ó¦¸ÃÊÇ×Ö·ûÎÊÌâ°É¡£
ÎÒÓõÄÊÇFedora11.ÇëÎÊÔõô½â¾ö°¡£¿
°££¬Ã»ÓÐÈ˻شðÎÒ
Ã²ËÆlinuxϵÄ×Ö·ûÊÇutf-8 ÊÇÓÃeclipseô£¿ Êǵϰ£¬°ÑËü¸Ä»Øgbk¾Í¿ÉÒÔÁË¡£
ϵͳÖÐÎÄ×ÖÌå°²×°ÁËÂð£¿
Ä ......