Linux?????ls?????????
???????????? ???????[ 2014/10/13 10:23:02 ] ?????????????? Linux
????????????????????:
1 void mode_to_char (mode_t mode?? char *buf)
2 {
3 memset(buf?? '-'?? 10);
4 if(S_ISDIR(mode))
5 buf[0] = 'd';
6 if(mode & S_IRUSR)
7 buf[1] = 'r';
8 if(mode & S_IWUSR)
9 buf[2] = 'w';
10 if(mode & S_IXUSR)
11 buf[3] = 'x';
12 if(mode & S_IRGRP)
13 buf[4] = 'r';
14 if(mode & S_IWGRP)
15 buf[5] = 'w';
16 if(mode & S_IXGRP)
17 buf[6] = 'x';
18 if(mode & S_IROTH)
19 buf[7] = 'r';
20 if(mode & S_IWOTH)
21 buf[8] = 'w';
22 if(mode & S_IXOTH)
23 buf[9] = 'x';
24 }
??????????????????????????????????????????????????侫????
??????????????????:
????1 char *time_change(char *time)
????2 {
????3 int index = strlen(time) - 1;
????4 for(; time[index] != ':'; index --);
????5 time[index] = '