OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // TODO(vtl): notes to self: | 5 // TODO(vtl): notes to self: |
6 // - file offsets, file positions, and file sizes are int64 (though positions | 6 // - file offsets, file positions, and file sizes are int64 (though positions |
7 // and sizes must always be non-negative) | 7 // and sizes must always be non-negative) |
8 // - buffer size parameters (for read/write) are uint32 | 8 // - buffer size parameters (for read/write) are uint32 |
9 | 9 |
10 [DartPackage="mojo_services"] | 10 [DartPackage="mojo_services"] |
11 module mojo.files; | 11 module mojo.files; |
12 | 12 |
13 import "files/public/interfaces/types.mojom"; | 13 import "files/interfaces/types.mojom"; |
14 | 14 |
15 // TODO(vtl): Write comments. | 15 // TODO(vtl): Write comments. |
16 interface File { | 16 interface File { |
17 // Flushes/closes this file; no operations may be performed on this file after | 17 // Flushes/closes this file; no operations may be performed on this file after |
18 // this. Note that any error code is strictly informational -- the close may | 18 // this. Note that any error code is strictly informational -- the close may |
19 // not be retried. | 19 // not be retried. |
20 Close() => (Error err); | 20 Close() => (Error err); |
21 | 21 |
22 // Reads (at most) |num_bytes_to_read| from the location specified by | 22 // Reads (at most) |num_bytes_to_read| from the location specified by |
23 // |offset|/|whence|. On success, |bytes_read| is set to the data read. | 23 // |offset|/|whence|. On success, |bytes_read| is set to the data read. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 // Special-file-specific control function, for device "files". |in| and |out| | 84 // Special-file-specific control function, for device "files". |in| and |out| |
85 // are dependent on |request|. See ioctl.mojom for the master list of request | 85 // are dependent on |request|. See ioctl.mojom for the master list of request |
86 // values. | 86 // values. |
87 Ioctl(uint32 request, array<uint32>? in_values) | 87 Ioctl(uint32 request, array<uint32>? in_values) |
88 => (Error error, array<uint32>? out_values); | 88 => (Error error, array<uint32>? out_values); |
89 | 89 |
90 // TODO(vtl): Add a "watch"? | 90 // TODO(vtl): Add a "watch"? |
91 // TODO(vtl): Add something analogous to fsync(2)? | 91 // TODO(vtl): Add something analogous to fsync(2)? |
92 }; | 92 }; |
OLD | NEW |