equal
deleted
inserted
replaced
15 |
15 |
16 int isDir (char *filename) |
16 int isDir (char *filename) |
17 { |
17 { |
18 struct stat buf; |
18 struct stat buf; |
19 |
19 |
20 if (!stat (filename, &buf)) |
20 if (!lstat (filename, &buf)) |
21 return (S_ISDIR (buf.st_mode)); |
21 return (S_ISDIR (buf.st_mode)); |
22 |
22 |
23 return 0; |
23 return 0; |
24 } |
24 } |
25 |
25 |
26 int isFile (char *filename) |
26 int isFile (char *filename) |
27 { |
27 { |
28 struct stat buf; |
28 struct stat buf; |
29 |
29 |
30 if (!stat (filename, &buf)) |
30 if (!lstat (filename, &buf)) |
31 return (S_ISREG (buf.st_mode)); |
31 return (S_ISREG (buf.st_mode)); |
|
32 |
|
33 return 0; |
|
34 } |
|
35 |
|
36 int isLink (char *filename) |
|
37 { |
|
38 struct stat buf; |
|
39 |
|
40 if (!lstat (filename, &buf)) |
|
41 return (S_ISLNK (buf.st_mode)); |
32 |
42 |
33 return 0; |
43 return 0; |
34 } |
44 } |
35 |
45 |
36 void getdir (char *root, int recursive) |
46 void getdir (char *root, int recursive) |