Linux Ï CÓïÑÔ´óÎļþ¶Áд(´óÓÚ4G£©
ÒÔϵÄ×ö·¨ÕûÀí×ÔÂÛ̳ÉϵÄÌû×Ó¡£
ÈçºÎcreate´óÎļþ
Òª´ó¾Í·Ç³£´ó£¬1T°É¡£
ÓÐÁ½ÖÖ·½·¨£º
Ò».dd
dd if=/dev/zero of=1T.img bs=1G seek=1024 count=0
bs=1G±íʾÿһ´Î¶Áд1GÊý¾Ý£¬count=0±íʾ¶Áд0´Î£¬seek=1024±íʾÂÔ¹ý1024¸öBlock²»Ð´£¬Ç°Ãæblock sizeÊÇ1G£¬ËùÒÔ¹²ÂÔ¹ý1T£¡
ÕâÊÇ´´½¨´óÐÍsparseÎļþ×î¼òµ¥µÄ·½·¨¡£
¶þ.ftruncate64/ftruncate
Èç¹ûÓÃϵͳº¯Êý¾ÍÉÔ΢ÓÐЩÂé·³£¬ÒòΪÉæ¼°µ½ºêµÄÎÊÌâ¡£ÎÒ»á½áºÏÒ»¸öʵ¼ÊÀý×ÓÏêϸ˵Ã÷£¬ÆäÖÐOPTION±êÖ¾µÄ¾ÍÊDzâÊÔÏî¡£
Îļþsparse.c:
//OPTION 1:ÊÇ·ñ¶¨ÒåÓë´óÎļþÏà¹ØµÄºê
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#define FILENAME "bigfile"
#define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
int main(int argc, char **argv)
{
int fd, ret;
off_t offset;
int total = 0;
if ( argc >= 2 )
{
total = atol(argv[1]);
printf("total=%d\n", total);
}
//OPTION 2:ÊÇ·ñÓÐO_LARGEFILEÑ¡Ïî
//fd = open(FILENAME, O_RDWR|O_CREAT|O_LARGEFILE, 0644);
fd = open(FILENAME, O_RDWR|O_CREAT, 0644);
if (fd < 0) {
perror(FILENAME);
return -1;
}
offset = (off_t)total *1024ll*1024ll*1024ll;
printf("offset=%ld\n", offset);
//OPTION 3£ºÊÇ·ñµ÷ÓÃ64λϵͳº¯Êý
//if (ftruncate64(fd, offset) < 0)
if (ftruncate(fd, offset) < 0)
{
printf("[%d]-ftruncate64 error: %s\n", errno, strerror(errno));
close(fd);
return 0;
}
close(fd);
printf("OK\n");
return 0;
}
²âÊÔ»·¾³£º
linux:/disk/test/big # gcc --version
gcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)
linux:/disk/test/big # uname -a
Linux linux 2.6.11.4-20a-default #1 Wed Mar 23 21:52:37 UTC 2005 i686 i686 i386 GNU/Linux
²âÊÔ½á¹û
Ïà¹ØÎĵµ£º
×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......
linuxϵĵ÷ÊÔ¹¤¾ß
Ëæ×ÅXPµÄÁ÷ÐУ¬ÈËÃÇÔ½À´Ô½×¢ÖØÈí¼þµÄÇ°ÆÚÉè¼Æ¡¢ºóÆÚµÄʵÏÖ£¬ÒÔ¼°¹á´©ÓÚÆäÖеIJâÊÔ¹¤×÷£¬¾¹ýÕâ¸ö¹ý³Ì³öÀ´µÄ×ÔÈ»ÊǸßÖÊÁ¿µÄÈí¼þ¡£ÉõÖÁÓÐÈËÉù³ÆXP »áÌÔ̵÷ÊÔÆ÷£¡Õ⵱ȻÊÇÓÐÒ»¶¨µÀÀíµÄ£¬È»¶ø¾ÍÄ¿Ç°µÄÏÖʵÀ´¿´£¬Õ⻹ÊÇÒ»ÖÖÀíÏë¡£ÔÚÈÕ³£¹¤×÷ÖУ¬µ÷ÊÔ¹¤¾ß»¹ÊDZز»¿ÉÉٵġ£ÔÚLinuxÏ£¬µ÷ÊÔ¹¤¾ ......
µÚÒ»²½:ÏÂÔØFLASHµÄ²å¼þ
http://www.adobe.com/ÔÚÕâ¸öÒ³ÃæÉÏÓкܶà²å¼þ,ÔÚÕâÀïÄãÖ»ÓÃÏÂÔØ
ÎļþÃû×Ö:install_flash_player_9_linux.tar.gz
µÚ¶þ²½:½âѹÎļþ°ü
µ±Ç°µÄ¹¤×÷Ŀ¼ÊÇ:USR
[root@isitqnx usr]#tar zvxf install_flash_player_7_linux.tar.gz µÃµ½Ò»¸öͬÃûÎļ ......
ÔÚÖƶ¨±ê׼ʱ£¬
C89
ίԱ»á¹Ø×¢ÏÂÁм¸¸öÔÔò£¬ÕâЩÔÔòÖ±µ½½ñÌ컹ÔÚÖ¸µ¼ÎÒÃÇ¿¼ÂÇÎÊÌâ¡£×îÖØÒªµÄ¼¸¸öÔÔòÈçÏ£º
ÏÖ´æ´úÂëºÜÖØÒª£¬¶øÏÖ´æµÄ
C
±àÒëÆ÷ʵÏÖ²¢²»ÖØÒª¡£
C
´úÂëÄܹ»ÊÇ¿ÉÒÆÖ²µÄ¡£
C
´úÂë¿ÉÒÔÊDz»¿ÉÒÆÖ²µÄ¡£
C89
ίԱ»á²»Ï£Íû×èÖ¹
C
³ÌÐòԱд»úÆ÷רÓôúÂ룬ÒòΪÕâÊÇ
C
µÄÒ»¸öÇ¿Ïî¡£ÕâÔì³ÉÁËÑϸñÒ» ......