linux statº¯Êý½²½â
statº¯Êý½²½â£¨×ª£©
±íÍ·Îļþ: #include <sys/stat.h>
#include <unistd.h>
¶¨Ò庯Êý: int stat(const char *file_name, struct stat *buf);
º¯Êý˵Ã÷: ͨ¹ýÎļþÃûfilename»ñÈ¡ÎļþÐÅÏ¢£¬²¢±£´æÔÚbufËùÖ¸µÄ½á¹¹ÌåstatÖÐ
·µ»ØÖµ: Ö´Ðгɹ¦Ôò·µ»Ø0£¬Ê§°Ü·µ»Ø-1£¬´íÎó´úÂë´æÓÚerrno
´íÎó´úÂë:
ENOENT ²ÎÊýfile_nameÖ¸¶¨µÄÎļþ²»´æÔÚ
ENOTDIR ·¾¶ÖеÄĿ¼´æÔÚµ«È´·ÇÕæÕýµÄĿ¼
ELOOP Óû´ò¿ªµÄÎļþÓйý¶à·ûºÅÁ¬½ÓÎÊÌ⣬ÉÏÏÞΪ16·ûºÅÁ¬½Ó
EFAULT ²ÎÊýbufΪÎÞЧָÕ룬ָÏòÎÞ·¨´æÔÚµÄÄÚ´æ¿Õ¼ä
EACCESS ´æÈ¡Îļþʱ±»¾Ü¾ø
ENOMEM ºËÐÄÄÚ´æ²»×ã
ENAMETOOLONG ²ÎÊýfile_nameµÄ·¾¶Ãû³ÆÌ«³¤
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
int main() {
struct stat buf;
stat("/etc/hosts", &buf);
printf("/etc/hosts file size = %d\n", buf.st_size);
}
-----------------------------------------------------
struct stat {
dev_t st_dev; //ÎļþµÄÉ豸±àºÅ
ino_t st_ino; //½Úµã
mode_t st_mode; //ÎļþµÄÀàÐͺʹæÈ¡µÄȨÏÞ
nlink_t st_nlink; //Á¬µ½¸ÃÎļþµÄÓ²Á¬½ÓÊýÄ¿£¬¸Õ½¨Á¢µÄÎļþֵΪ1
uid_t st_uid;  
Ïà¹ØÎĵµ£º
ÈçºÎ¿ªÆô¹Ø±Õlinux·À»ðǽ
¡¡¡¡ÖØÆôºóÉúЧ
¡¡¡¡¿ªÆô£ºchkconfig iptables on
¡¡¡¡¹Ø±Õ£ºchkconfig iptables off
¡¡¡¡¼´Ê±ÉúЧ£¬ÖØÆôºóʧЧ
¡¡¡¡¿ªÆô£ºservice iptables start
¡¡¡¡¹Ø±Õ£ºservice iptables stop
¡¡¡¡»ò
¡¡¡¡¹Ø±Õ£º /etc/rc.d/init.d/iptables stop
¡¡¡¡Æô¶¯£º /etc/rc.d/init.d/ip ......
×î½ü¸ºÔðµÄsvrѹÁ¦±È½Ï´ó£¬ÒµÎñÂß¼Óе㸴ÔÓ,ÄÜÓÅ»¯µÄµØ·½ÒѾȫ²¿ÓÅ»¯ÁË£¬ ĿǰÿÃë3k´Î£¬cpu¸ºÔØ»¹ÊÇ±È½Ï¸ß top¿´Ò»Ï£¬4ºËµÄcpu¸ºÔز»ÊÇÌ«¾ùºâ£¬´òË㿼ÂÇһϽ«ÒµÎñ½ø³ÌÖ¸¶¨µ½3¸öcpuÉÏÔËÐУ¬ÁíÍâÒ»¸öcpuרߺÔð´¦ÀíÍøÂçÊÕ·¢°ü£»´òËã³¢ÊÔһϣ¬Èç¹û»¹ÊDz»ÐУ¬ÔÙ¹ý¶Îʱ¼ä£¬·ÃÎÊÁ¿ÔÙÔö¼ÓµÄ»°£¬¾ÍÒª¼Ó»úÆ÷ÁË£¬ÎØÎØ ²¹ ......
Ò»£º°²×°jdk Îҵİ汾ÊÇ£ºjdk-6u10-linux-i586.rpm
°²×°jdk1.6°²×°°ü£º rpm -ivh jdk-6u10-linux-i586.rpm
ÅäÖû·¾³±äÁ¿£º
1£¬½øÈëprofileÎļþ£ºvi/etc/profile
2,ÔÚÎļþÖÐÌí¼ÓÒÔÏ´úÂ룺
export JAVA_HOME = /usr/usr/java/jdk1.6.0_10 --jdk°²×°Ä¿Â¼
export CALSSPATH = $JAVA_HOM ......
¡¡Í¨¹ý SCSI ÃüÁî¹ÜÀí¼ÆËã»úÉϵÄÊý¾Ý£¬²¢½«Êý¾Ý´«Êäµ½ SCSI É豸¡£ÔÚ±¾ÎÄÖУ¬×÷Õß½éÉÜÁËһЩ SCSI ÃüÁÒÔ¼°ÔÚ Linux? ÖÐʹÓà SCSI API ʱִÐÐ SCSI ÃüÁîµÄ·½·¨¡£Ëû½éÉÜÁË SCSI ¿Í»§»ú/·þÎñÆ÷Ä£Ðͺʹ洢 SCSI ÃüÁîµÄ±³¾°¡£½ÓÏÂÀ´½âÊÍ Linux ͨÓà SCSI Çý¶¯Æ÷ API£¬²¢Ìṩһ¸öʾÀý£¬ÌÖÂÛʹÓÃͨÓÃÇý¶¯Æ÷Ö´ÐÐ inquiry ÃüÁîµÄÏ ......
°²×°²½Ö裺
Ø °²×°tomcatÇ°ÏÈÒª±£Ö¤°²×°ÁËJDK£¬¿ÉÒÔÓÃÃüÁî²é¿´ÊÇ·ñ°²×°ÁËJDK£º
[root@wxr webapps]# java -version
java version "1.6.0_19"
Java(TM) SE Runtime Environment (build 1.6.0_19-b04)
Java HotSpot(TM) Client VM (build 16.2-b04, mixed mode, sharing)
Ø ÏÂÔØTom ......