Changeset 94 in libcf for trunk/src/cf_file.c
- Timestamp:
- 05/25/13 22:36:56 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cf_file.c
r93 r94 198 198 */ 199 199 int 200 CF_File_GetSize (const int fd) 201 { 202 int result = 0; 203 204 ASSERT_ARGS (fd < 0); 205 206 result = (int) lseek (fd, 0, SEEK_END); 207 if (result < 0 || lseek (fd, 0, SEEK_SET) < 0) 200 CF_File_GetSize (const char * path) 201 { 202 int length = 0; 203 int fd = 0; 204 205 ASSERT_ARGS (path == NULL); 206 207 fd = CF_File_Open (path, CF_FILE_READ); 208 if (fd < 0) 209 return CF_ERROR_FILE_OPEN; 210 211 length = (int) lseek (fd, 0, SEEK_END); 212 if (length < 0) 208 213 return CF_ERROR_FILE_GET_SIZE; 209 214 210 return result; 215 CF_File_Close (fd); 216 217 return length; 211 218 } 212 219
Note:
See TracChangeset
for help on using the changeset viewer.