 |
Changeset 2620
- Timestamp:
- 10/04/07 23:39:44
(1 year ago)
- Author:
- kris
- Message:
added O_LARGEFILE to linux file open
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2505 |
r2620 |
|
| 507 | 507 | alias int[] Flags; |
|---|
| 508 | 508 | |
|---|
| | 509 | const O_LARGEFILE = 0x8000; |
|---|
| | 510 | |
|---|
| 509 | 511 | static const Flags Access = |
|---|
| 510 | 512 | [ |
|---|
| 511 | | 0, // invalid |
|---|
| | 513 | 0, // invalid |
|---|
| 512 | 514 | O_RDONLY, |
|---|
| 513 | 515 | O_WRONLY, |
|---|
| … | … | |
| 517 | 519 | static const Flags Create = |
|---|
| 518 | 520 | [ |
|---|
| 519 | | 0, // open existing |
|---|
| 520 | | O_CREAT | O_TRUNC, // truncate always |
|---|
| 521 | | O_CREAT, // create if needed |
|---|
| 522 | | O_APPEND | O_CREAT, |
|---|
| | 521 | 0, // open existing |
|---|
| | 522 | O_CREAT | O_TRUNC, // truncate always |
|---|
| | 523 | O_CREAT, // create if needed |
|---|
| | 524 | O_APPEND | O_CREAT, // append |
|---|
| 523 | 525 | ]; |
|---|
| 524 | 526 | |
|---|
| 525 | 527 | static const short[] Locks = |
|---|
| 526 | 528 | [ |
|---|
| 527 | | F_WRLCK, // no sharing |
|---|
| 528 | | F_RDLCK, // shared read |
|---|
| | 529 | F_WRLCK, // no sharing |
|---|
| | 530 | F_RDLCK, // shared read |
|---|
| 529 | 531 | ]; |
|---|
| 530 | 532 | |
|---|
| 531 | 533 | auto mode = Access[style.access] | Create[style.open]; |
|---|
| 532 | | handle = posix.open (path.cString.ptr, mode, 0666); |
|---|
| | 534 | |
|---|
| | 535 | // always open as a large file |
|---|
| | 536 | handle = posix.open (path.cString.ptr, mode | O_LARGEFILE, 0666); |
|---|
| 533 | 537 | if (handle is -1) |
|---|
| 534 | 538 | error (); |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic