ÔÚLinuxÏÂдµÄÎļþ½á¹¹Ë÷Òý½ÚµãµÄ·ÃÎÊ
ÔÚLinuxÏÂдµÄÒ»¸ö¹ØÓÚÎļþ½á¹¹Ë÷ÒýµÄ·ÃÎÊ£¬Ë÷Òý½Úµãinode_stat.st_devÎÞ·¨·ÃÎÊ£¬ÕâÊÇÔõô»ØÊÂŶ£¿£¿
ÁíÍâÓ²Á´½ÓÒ²³ö´íÁË£¿£¿£¿
Ï£ÍûÓÐλ¸ßÊÖÄܸøÎÒ˵˵ÔÒò¡£¡£
´úÂëÈçÏ£º
C/C++ code:
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
//ʹÓÃλ²Ù×÷»ñµÃÉ豸µÄÖ÷É豸ºÅºÍ´ÎÉ豸ºÅ
#define major_dev_number(x) (int)(unsigned short(x)>>8)
#define minor_dev_number(x) (int)(unsigned short(0)&0xFF)
#define FILE_TYPE 0
#define DEVICE_TYPE 1
void error_quit(char *err_string)
{
fprintf(stderr, "%s \n", err_string);
exit(1);
}
void print_inode(struct stat inode_stat)
{
int file_type;
switch(inode_stat.st_mode&S_IFMT)
{
case S_IFREG:
printf("common file \n");
break;
case S_IFDIR:
printf("Derectory \n");
break;
case S_IFIFO:
printf("Named pipe \n");
break;
case S_IFBLK:
printf("block device file \n");
file_type = DEVICE_TYPE;
break;
case S_IFCHR:
printf("character device file \n");
file_type = DEVICE_TYPE;
break;
default:
printf("unknow file type \n");
Ïà¹ØÎÊ´ð£º
ʹÓÃPHPµÄexecº¯Êýµ÷ÓÃlinuxµÄshellÃüÁÈçdateÈ¥ÐÞ¸Äʱ¼ä»òshutdownȥʵÏֹػú/ÖØÆô£¬µ«ÊÇ·µ»ØÖµ¶¼ÊÇʧ°ÜµÄ¡£¾¹ý¶à´ÎÊÔÑ飬È϶¨ÊÇûÓÐȨÏÞµÄÎÊÌâ¡£
ËùÒÔ£¬Ð¡µÜÔÚ´ËÇë½Ì¸÷룬ÈçºÎ²ÅÄÜÉèÖÃȨÏÞ£¬µ÷ÓÃlinux shellà ......
ÎÒ֮ǰÖÆ×÷µÄlinux×Ô¶¯°²×°isoÒѾ³É¹¦ÁË£¬ÏÖÔÚÏë¶ÔÆä½øÐÐһЩ¶¨ÖÆÐ޸ģ¬±ÈÈ磬¸ü¸ÄgrubͼƬµÈ¡£
ÎÒÔÚks.cfgµÄ%post¶ÎÀïÃæÊÇÕâÑùдµÄ£º
%post --nochroot
# Move the contents of the tar into their new locati ......
ÎÒÃÇÁ¥ÊôÖпÆÔº¼ÆËãËùÍøÂçÖصãʵÑéÊÒ(http://www.ict.ac.cn/survey/channel/detail443.asp)»ù´¡ÉèÊ©¿ÎÌâ×é.
ÏÖÒòÏîÄ¿ºÍÒµÎñÍØÕ¹µÄÐèÒª,ÌØÐèÒªÕÐƸÓëÏîÄ¿Ïà¹ØµÄÍøÂçÓ¦Óù¤³Ìʦ1-2Ãû¡£
¾ßÌåÒªÇóÈçÏ¡£ÓÐÒâÕß ......
ÎÒÔÚLINUXÉÏÓÐÁ½¸öÓû§
Ò» root
¶þ myadmin
¡¾myadmin@localhost~¡¿$ dir
Desktop myphp
[myadminlocalhost~]$ cd myphp¡¢DesktopÄܽøÈ¥ÆäËûµÄϵͳĿ¼½ø²»È¥
Ö»ÓÐÕâÁ½¸öĿ¼ ÎÒÏë½øÈëÆäËûµÄÏ ......
while(1)
{
time_t now;
time(&now);
struct tm* pt=localtime(&now);
cout < < "µ±Ç°Ê±¼ä" < < pt->t ......