version 1.1.2.2, 2010/07/13 11:04:09
|
version 1.1.2.3, 2010/07/13 11:22:36
|
Line 85 cmpDir(const char *csDir1, const char *csDir2, struct
|
Line 85 cmpDir(const char *csDir1, const char *csDir2, struct
|
memset(l, 0, sizeof(struct tagDirName)); |
memset(l, 0, sizeof(struct tagDirName)); |
} |
} |
|
|
dir = opendir(csDir1); | if (chdir(csDir1) == -1) { |
| printf("Error:: %s(%d) #%d - %s\n", __func__, __LINE__, errno, strerror(errno)); |
| free(l); |
| return -1; |
| } |
| dir = opendir("."); |
if (!dir) { |
if (!dir) { |
printf("Error:: %s(%d) #%d - %s\n", __func__, __LINE__, errno, strerror(errno)); |
printf("Error:: %s(%d) #%d - %s\n", __func__, __LINE__, errno, strerror(errno)); |
free(l); |
free(l); |
Line 110 cmpDir(const char *csDir1, const char *csDir2, struct
|
Line 115 cmpDir(const char *csDir1, const char *csDir2, struct
|
if (lm) { |
if (lm) { |
if (lstat(d.d_name, &sb) != -1) { |
if (lstat(d.d_name, &sb) != -1) { |
memset(szStr, 0, MAX_STR); |
memset(szStr, 0, MAX_STR); |
strftime(szStr, MAX_STR, "%y-%m-%d %H:%M:%S", localtime((time_t*) &sb.st_mtim)); | strftime(szStr, MAX_STR, "%Y-%m-%d %H:%M:%S", localtime((time_t*) &sb.st_mtim)); |
switch (d.d_type) { |
switch (d.d_type) { |
case DT_FIFO: |
case DT_FIFO: |
strlcpy(szType, "fifo", MAX_STR); |
strlcpy(szType, "fifo", MAX_STR); |
Line 141 cmpDir(const char *csDir1, const char *csDir2, struct
|
Line 146 cmpDir(const char *csDir1, const char *csDir2, struct
|
strlcpy(szType, "unknown", MAX_STR); |
strlcpy(szType, "unknown", MAX_STR); |
break; |
break; |
} |
} |
snprintf(l[n].extra, MAX_STR, "%s links=%d %d:%d perm=0%o size=%llu %s\n", szType, | snprintf(l[n].extra, MAX_STR, "%s links=%d inode=%u %d:%d perm=0%o size=%llu %s", |
sb.st_nlink, sb.st_uid, sb.st_gid, sb.st_mode & 0x1fff, | szType, sb.st_nlink, sb.st_ino, sb.st_uid, sb.st_gid, |
sb.st_size, szStr); | sb.st_mode & 0x1fff, sb.st_size, szStr); |
} |
} |
} |
} |
|
|
Line 155 cmpDir(const char *csDir1, const char *csDir2, struct
|
Line 160 cmpDir(const char *csDir1, const char *csDir2, struct
|
tags[l[i].tag] = i; |
tags[l[i].tag] = i; |
|
|
// open dir 2 for diff ... |
// open dir 2 for diff ... |
dir = opendir(csDir2); | if (chdir(csDir2) == -1) { |
| printf("Error:: %s(%d) #%d - %s\n", __func__, __LINE__, errno, strerror(errno)); |
| free(l); |
| return -1; |
| } |
| dir = opendir("."); |
if (!dir) { |
if (!dir) { |
printf("Error:: %s(%d) #%d - %s\n", __func__, __LINE__, errno, strerror(errno)); |
printf("Error:: %s(%d) #%d - %s\n", __func__, __LINE__, errno, strerror(errno)); |
free(l); |
free(l); |
Line 198 cmpDir(const char *csDir1, const char *csDir2, struct
|
Line 208 cmpDir(const char *csDir1, const char *csDir2, struct
|
if (lm) { |
if (lm) { |
if (lstat(d.d_name, &sb) != -1) { |
if (lstat(d.d_name, &sb) != -1) { |
memset(szStr, 0, MAX_STR); |
memset(szStr, 0, MAX_STR); |
strftime(szStr, MAX_STR, "%y-%m-%d %H:%M:%S", localtime((time_t*) &sb.st_mtim)); | strftime(szStr, MAX_STR, "%Y-%m-%d %H:%M:%S", localtime((time_t*) &sb.st_mtim)); |
switch (d.d_type) { |
switch (d.d_type) { |
case DT_FIFO: |
case DT_FIFO: |
strlcpy(szType, "fifo", MAX_STR); |
strlcpy(szType, "fifo", MAX_STR); |
Line 229 cmpDir(const char *csDir1, const char *csDir2, struct
|
Line 239 cmpDir(const char *csDir1, const char *csDir2, struct
|
strlcpy(szType, "unknown", MAX_STR); |
strlcpy(szType, "unknown", MAX_STR); |
break; |
break; |
} |
} |
snprintf(l[n].extra, MAX_STR, "%s links=%d %d:%d perm=0%o size=%llu %s\n", szType, | snprintf(l[n].extra, MAX_STR, "%s links=%d inode=%u %d:%d perm=0%o size=%llu %s", |
sb.st_nlink, sb.st_uid, sb.st_gid, sb.st_mode & 0x1fff, | szType, sb.st_nlink, sb.st_ino, sb.st_uid, sb.st_gid, |
sb.st_size, szStr); | sb.st_mode & 0x1fff, sb.st_size, szStr); |
} |
} |
} |
} |
|
|