PerlÎļþ²âÊÔ·û CµÄÓ÷¨
ÔÚPerlµÄ¸÷ÖÖÎļþ²âÊÔÔËËã·ûÖУ¬×îÓÐÓõÄÔËËã·ûÖ®Ò»¾ÍÊÇ -C ÁË¡£
Ëü·µ»ØµÄÊÇÎļþµÄctimeµ½³ÌÐòÆô¶¯µÄÄÇһʱ¿Ì¾¹ýµÄÌìÊý¡£
Èç¹û²»ÊÇÕûÊýÌ죬·µ»ØÖµ¾Í´øÓÐСÊý¡£
Õâ¸öÔËËã·û¾³£ÓÃÀ´¼ì²âÎļþÊÇ·ñ¹ýÆÚ£¬±ÈÈçÅжÏÎļþ¾àÀëÉÏ´ÎÐÞ¸ÄÊÇ·ñ³¬¹ýÁË3Ì죬
Èç¹û³¬¹ý¾Í½«Æäɾ³ý¡£µ«ÊÇ£¬ÄãÊÇ·ñÕæÕýÀí½â -C µÄ¹¤×÷ÔÀíÄØ£¿
ºÎνctime
ÒªÏëÀí½â-C£¬¾Í±ØÐëÀí½âʲôÊÇctime¡£ÎÒÃÇÖªµÀÎļþ²âÊÔÔËËã·ûµÄ·µ»ØÖµ¶¼ÊÇstatϵͳµ÷ÓõĽá¹û£¬
Òò´Ë´ÓstatµÄÎĵµÖоͿÉÒÔÕÒµ½´ð°¸£º
$ man 2 stat
...
The field st_ctime is changed by writing or by setting inode information
(i.e., owner, group, link count, mode, etc.).
¿É¼û£¬ctimeÊÇinodeµÄ¸üÐÂʱ¼ä£¬Òò´Ë²»½öÊǸıäÎļþÄÚÈÝ£¬Òƶ¯Îļþ¡¢ÐÞ¸ÄËùÓÐÕߵȲÙ×÷¶¼»á¸Ä±äctime¡£
ÕâƪÎÄÕÂ
˵µÃ¸üÏêϸ£º
ÎļþµÄ Change time£¬ctime ÊÇÔÚдÈëÎļþ¡¢¸ü¸ÄËùÓÐÕß¡¢È¨ÏÞ»òÁ´½ÓÉèÖÃʱ
Ëæ Inode µÄÄÚÈݸü¸Ä¶ø¸ü¸ÄµÄ¡£Ö»Òªstat³öÀ´µÄÄÚÈÝ·¢Éú¸Ä±ä¾Í»á·¢Éú¸Ä±ä¡£
mtimeµÄ¸Ä±ä±ØÈ»µ¼ÖÂctimeµÄ¸Ä±ä¡£
-CµÄÖµÈçºÎ¼ÆË㣿
perlµÄÎĵµÖжÔ-CÊÇÕâÑù˵Ã÷µÄ£º
$ perldoc -f -X
...
-M Script start time minus file modification time, in days.
-A Same for access time.
-C Same for inode change time (Unix, may differ for other platforms)
Ò²¾ÍÊÇ˵£¬-C Êǽű¾Ö´ÐпªÊ¼ÄÇÒ»¿Ì¾àÀëÎļþµÄctimeÖ®¼äµÄÌìÊý¡£
ÓüÆËãʽÀ´±íÊö£¬¿ÉÒÔÕâÑùд£º
(($^T - ((stat($filename))[10])) / 86400)
$^TÊÇPerl¿ªÊ¼Ö´ÐÐʱµÄʱ¼ä´Á¡£
Òò´Ë£¬ÔÚͬһ¸ö³ÌÐòÖÐÁ½´ÎÖ´ÐÐ -C µÄ½á¹ûÊÇÒ»ÑùµÄ¡£
ËùÒÔ£¬ÏÂÃæÕâ¸ö³ÌÐòµÃµ½µÄÊÇÏàͬµÄ½á¹û£º
print -C "foo.bar";
sleep 10;
print -C "foo.bar";
ͬÑù£¬ÔÚmod_perl»·¾³Ï£¬Ö»Òª·þÎñÆ÷ûÓÐÖØÆô£¬ÄÇôÈκÎʱºòÖ´ÐÐ-CµÃµ½µÄ½á¹û¶¼Ïàͬ¡£
£¨Êµ¼ÊÉÏÉÏÃæÕâ¾ä»°²¢²»ÑÏÃÜ£¬ÒòΪhttpd»áͬʱÆô¶¯Êý¸ö½ø³Ì£¬¶ø¶à¸ö½ø³ÌµÄ$^T²¢²»Ò»¶¨Ïàͬ£¬´Ó¶ø-CµÄ½á¹ûÒ²ÓпÉÄܲ»Í¬¡£
ÁíÍ⣬һ°ãÇé¿öÏÂhttpd½ø³ÌÔÚ´¦ÀíÍêÒ»¶¨µÄÇëÇóÖ®ºó£¬½ø³Ì»á½áÊø²¢Æô¶¯Ò»¸öнø³Ì£¬Ò²»áʹµÃ$^TÖØÖã¬Ó°Ïì-CµÄ½á¹û¡££©
ÄÇô£¬ÈçºÎ»ñµÃÖ´ÐÐ
ÄÇÒ»¿Ì¾àÀëctimeµÄÌìÊýÄØ£¿
ÓÐÁËÉÏÃæµÄ¹«Ê½£¬²»Äѵóö£¬Ó¦¸ÃÕâÑù¼ÆË㣺
(-C $filename) + (time() - $^T) / 86400
Ïà¹ØÎĵµ£º
int main(int argc, char* argv[])
{
/**//* ************************************************************
Ö¸Õë
**************************************************************/
......
½øÈëandroid shellºó»á´òÓ¡£º
sh: can't access tty; job control turned off
ÊäÈëtab¼üûÓв¹È«£¬ÊäÈëctrl+cûÓÐÖÕÖ¹µ½ÏÂÒ»ÐУ¬¶øÊÇÊäÈëÒ»¸öÂÒÆß°ËÔãµÄ×Ö·û£¬
ûÓÐcpÃüÁîµÈµÈµÈµÈ£¬
Äã»á·¢ÏÖ£¬ÕâËûÂ軹ÊÇlinuxÂð,ÕâÈÕ×Óû·¨¹ýÁË£¬¼òÖ±£¡
ÒªÖ§³ÖһЩ³£ÓõÄÃüÁ
ÐèÒªÖØбàÒëÒ»¸öbusybox£¬
make menuconfig
ÏÈÑ¡Ôñ ......
ǰһƪÎÒÃǽéÉÜÁËÒ»¸ö¼òµ¥²»¹ýµÄhelloworld³ÌÐòÒý³öÏà¹ØÎÊÌâ¡£³Ã×Å»¹Ã»ÓÐÍüµôÄÇЩ˼¿¼·½Ê½µÄ¼ÇÒ䣬±¾Æª¼ÌÐøÑÓÐøÕâÖÖ˼ά·½Ê½µÄÀíÄ½éÉÜÒ»ÏÂCC++ÖеĻù±¾Êý¾ÝÀàÐÍ¡£Êý¾ÝÀàÐͲ»Çå³þµÄ»°ÔÚÒÔºóµÄ±à³ÌÖлáÓкܶàÃÕÍźÍÎÊÌâ¡£ÉõÖÁÒ»¸ö³ÌÐòµÄBUGÕÒ°ëÌìҲûÓÐÕÒ³öÀ´Ê±ÎªÊ²Ã´£¬½á¹û²Å·¢ÏÖÊǼӼõÒç³öÁË¡£¸ü¼ÓÑÏÖصĻ¹ÓÐдԽ½ç¡¢¶ÁÔ ......
C£¬C++ÍøÂç±à³Ìѧϰ¼òÃ÷Ö¸ÄÏ
1. ÔúʵµÄC£¬C++»ù´¡ÖªÊ¶
²Î¿¼×ÊÁÏ¡¶C³ÌÐòÉè¼Æ¡·£¬¡¶C++ primer¡·¡£
2. TCP/IPÐÒé
¾µäÊéÊÇ£ºW.Richard Stevens Öø¡¶TCP/IPÏê½â¡·Èý¾íÊ飬¾í1ÊÇÐÒ飬¾í2ÊÇʵÏÖ£¬¾í3ÊÇTCPÊÂÎñÐÒéµÈ¡£»¹Óйٷ½µÄÐÒéÎĵµ£ºRFC
µ±È»Ò²¿ÉÒÔÔÚÍøÉÏÏÂÔصç×ÓÊé¡£
¾µäµÄ¿ªÔ´ÐÒé·ÖÎö¹¤¾ß£ºWireshark.
......
/* Offtimer.c.For auto halt. */
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
#define DELAY 60/* Time of sleeping */
int main()
{
time_t now;
struct tm *p;
while(1)
{
now = time(NULL);
&n ......