Changeset 5022
- Timestamp:
- 10/31/07 11:24:56 (8 months ago)
- Files:
-
- wired/trunk/wired/files.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wired/trunk/wired/files.c
r4986 r5022 1047 1047 static wd_file_type_t wd_files_type_with_stat(wi_string_t *path, struct stat *sbp) { 1048 1048 wi_string_t *typepath, *string; 1049 struct stat sb; 1050 wd_file_type_t type; 1049 1051 1050 1052 if(!S_ISDIR(sbp->st_mode)) 1051 1053 return WD_FILE_TYPE_FILE; 1052 1054 1053 typepath = wi_string_by_appending_path_component(path, WI_STR(WD_FILES_META_TYPE_PATH)); 1054 string = wi_autorelease(wi_string_init_with_contents_of_file(wi_string_alloc(), typepath)); 1055 typepath = wi_string_by_appending_path_component(path, WI_STR(WD_FILES_META_TYPE_PATH)); 1056 1057 if(!wi_file_stat(typepath, &sb) || sb.st_size > 8) 1058 return WD_FILE_TYPE_DIR; 1059 1060 string = wi_autorelease(wi_string_init_with_contents_of_file(wi_string_alloc(), typepath)); 1055 1061 1056 1062 if(!string) … … 1059 1065 wi_string_delete_surrounding_whitespace(string); 1060 1066 1061 return wi_string_uint32(string); 1067 type = wi_string_uint32(string); 1068 1069 if(type == WD_FILE_TYPE_FILE) 1070 type = WD_FILE_TYPE_DIR; 1071 1072 return type; 1062 1073 } 1063 1074
