Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux cÓïÑÔÖеÄchmodº¯Êý

chmodÖеÄmode_t²ÎÊý£¬ÈçºÎ¶¯Ì¬µÄ´«ÈëÖµ£¬ÀýÈç ÎÒÒª´«Èë0777»ò0444£¬µ«ÎÒÊäÈëµÄÊÇ×Ö·û´® Ôõôת»¯Îª8½øÖÆ
ÿ¸öģʽ¾ùÔ¤¶¨ÒåÓк꣬ÓÖÒòΪÆäʵ¿ÉÑ¡·ÖÖ§ÓÐÏÞ£¬Äã¿ÉÒÔÅжÏÊäÈëµÃ×Ö·û´®£¬Ê¹ÓÃswicthÖ®ÀàµÃ°ì·¨£¬¸øÒ»ÁÙʱ±äÁ¿¸³Ó費ͬµÃÖµµ÷ÓÃchmod¡£

ʹÓÃatoiº¯Êý½«×Ö·û´®×ª»»ÎªÕûÊý£¬ÔÙ½«Õâ¸öÕûÊýת»»Îª°Ë½øÖÆÊý¼´¿É£¬È»ºóµ±Êµ²Î´«Èë

ѧϰ

C/C++ code:

/* ¹¦ ÄÜ£º¸Ä±äÎļþ·ÃÎÊȨÏÞ */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>

int main(int argc, char ** argv)
{
int mode; // ȨÏÞ
int mode_u; // ËùÓÐÕßµÄȨÏÞ
int mode_g; // ËùÊô×éµÄȨÏÞ
int mode_o; // ÆäËûÓû§µÄȨÏÞ
char *path;

/*¼ì²é²ÎÊý¸öÊýµÄºÏ·¨ÐÔ*/
if(argc < 3) {
printf("%s <mode num> <target file>\n",argv[0]);
exit(0);
}

/*»ñÈ¡ÃüÁîÐвÎÊý*/
mode = atoi(argv[1]);
if (mode > 777 || mode < 0) {
printf("mode num error!\n");
exit(0);
}
mode_u = mode / 100;
mode_g = (mode - (mode_u*100)) / 10;
mode_o = mode - (mode_u*100) - (mode_g*10);
mode = (mode_u * 8 * 8) + (mode_g * 8) + mode_o; // °Ë½øÖÆת»»
path = argv[2];

if ( chmod(path, mode) == -1) {
perror("chmod error");
exit(1);
}

return 0;
}



/


Ïà¹ØÎÊ´ð£º

²ËÄñÇó½â:cͼÐÎÎÊÌâ

#include <stdio.h>
#include <graphics.h>
void main()
{
  int x0,y0,x1,y1,driver,mode,i;
  driver=VGA;
  mode=VGAHI;
  initgraph(&driver,&mode,&qu ......

ÄϾ© ÖÐÐË C³ÌÐòÔ±ÕÐƸ

¹¤×÷ÄÚÈÝ Ñз¢

×ʸñÒªÇó£º
211ºÍÖصãԺУ±¾¿Æ 3Ä깤×÷¾­Ñé
211ºÍÖصãԺУ˶ʿ 1Ä깤×÷¾­Ñé

ÆÕͨԺУÔÚ¹¤×÷ÄêÏÞÉϸ÷¼Ó1Äê


ÓÐͨÐÅÏà¹Ø¿ª·¢¾­ÑéÕßÓÅÏÈ£¬µ±È»C/C++ »ù´¡ÒªÔúʵ

à ......

CÖеÄһЩСÎÊÌâ¡£¡£¡£

/* Note:Your choice is C IDE

×÷Ó㺠Ëæ»úÊý¼ÓÃÜ·¨£¬£¬£¬£¬
ÒÔÏÂÓÐÐí¶à²»¶®£¬Çë½Ìһϣ¬ÇëÖ÷Òâ´úÂë;
*/
#include <stdio.h>
#include <stdlib.h>
union
{
int value;
struct
{
c ......

CÅÌÉ϶à³ö2GÄÚÈÝ

CÅÌÉ϶àµÄÎļþÃûΪ£ºdosh , Recycled ,System Volum information, AUTOEXEC.BAT, BOOT.INT , bootfoot.bin, CONFIG.SYS,IO.SYS, MSDOS.SYS, DETECT.COM ,ntldr, pagefile.sys;
¶øÇÒÿ¸öÅÌÉ϶¼ÓÐÕâЩÎļþ£ºRECYCLER ......

ÇóÕäÆ·£¬´ÓÍ·ÎļþÖн«C½á¹¹½âÎö²¢Êä³ö³öÀ´¡£

±³¾°£º
£­£­£­£­£­£­£­£­
Í·Îļþdb_method.h¾­¹ýÃÀ»¯ºó´æÔÚÏÂÃ漸Öֽṹ¶¨ÒåÀàÐÍ
typedef struct
{
BYTE id;
BYTE idAsync;
DM_T dmInfo;
CHAR tbName[MAX_TBNAME_LEN];
} REC ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ