Differences From Artifact [752c197aa2]:
- File src/OFFile.m — part of check-in [06d2de4571] at 2014-12-13 16:52:58 on branch trunk — Use CLOEXEC for files and sockets (user: js, size: 22868) [annotate] [blame] [check-ins using]
To Artifact [10eb8531ab]:
- File
src/OFFile.m
— part of check-in
[46b89b1c8e]
at
2015-01-03 20:42:30
on branch trunk
— Introduce and use of_offset_t instead of off_t
The reason for this is that some systems, for example Android, use
32 bits for off_t while having size related fields like st_size as
long long. (user: js, size: 22810) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
476 477 478 479 480 481 482 | #else if (_wchdir([path UTF16String]) != 0) #endif @throw [OFChangeCurrentDirectoryPathFailedException exceptionWithPath: path]; } | | < | | 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | #else if (_wchdir([path UTF16String]) != 0) #endif @throw [OFChangeCurrentDirectoryPathFailedException exceptionWithPath: path]; } + (of_offset_t)sizeOfFileAtPath: (OFString*)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; if (of_stat(path, &s) == -1) /* FIXME: Maybe use another exception? */ @throw [OFOpenFileFailedException exceptionWithPath: path mode: @"r"]; return s.st_size; } + (OFDate*)modificationDateOfFileAtPath: (OFString*)path { of_stat_t s; if (path == nil) |
︙ | ︙ | |||
971 972 973 974 975 976 977 | if (_fd == -1 || _atEndOfStream || write(_fd, buffer, (unsigned int)length) < length) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length]; #endif } | | | | | 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 | if (_fd == -1 || _atEndOfStream || write(_fd, buffer, (unsigned int)length) < length) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length]; #endif } - (of_offset_t)lowlevelSeekToOffset: (of_offset_t)offset whence: (int)whence { of_offset_t ret = lseek(_fd, offset, whence); if (ret == -1) @throw [OFSeekFailedException exceptionWithStream: self offset: offset whence: whence]; _atEndOfStream = false; |
︙ | ︙ |