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 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
6 module mojo.files; | 6 module mojo.files; |
7 | 7 |
8 // Error codes used by the file manager. | 8 // Error codes used by the file manager. |
9 // TODO(vtl): Add more (to, e.g., cover all of errno). | 9 // TODO(vtl): Add more (to, e.g., cover all of errno). |
10 enum Error { | 10 enum Error { |
(...skipping 17 matching lines...) Expand all Loading... |
28 // Offset is relative to the end of the file. | 28 // Offset is relative to the end of the file. |
29 FROM_END, | 29 FROM_END, |
30 }; | 30 }; |
31 | 31 |
32 // Describes (idealized) wall-clock time, since Unix epoch (i.e., since | 32 // Describes (idealized) wall-clock time, since Unix epoch (i.e., since |
33 // "1970-01-01 00:00 UTC", ignoring leap seconds and that UTC as we know it | 33 // "1970-01-01 00:00 UTC", ignoring leap seconds and that UTC as we know it |
34 // started in 1972). | 34 // started in 1972). |
35 // TODO(vtl): Should probably be moved out of mojo.files (maybe to mojo.time?). | 35 // TODO(vtl): Should probably be moved out of mojo.files (maybe to mojo.time?). |
36 struct Timespec { | 36 struct Timespec { |
37 int64 seconds; | 37 int64 seconds; |
38 int32 nanoseconds; // Always in the interval [0, 10^9). | 38 int32 nanoseconds; // Always in the interval [0, 10^9). |
39 }; | 39 }; |
40 | 40 |
41 // Used for |Touch()| calls. If |now| is set, |timespec| must be null (the time | 41 // Used for |Touch()| calls. If |now| is set, |timespec| must be null (the time |
42 // "now" will be used). Otherwise, |timespec| must not be null. | 42 // "now" will be used). Otherwise, |timespec| must not be null. |
43 // TODO(vtl): Use a union instead, when that becomes possible. | 43 // TODO(vtl): Use a union instead, when that becomes possible. |
44 struct TimespecOrNow { | 44 struct TimespecOrNow { |
45 bool now; | 45 bool now; |
46 Timespec? timespec; | 46 Timespec? timespec; |
47 }; | 47 }; |
48 | 48 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 }; | 93 }; |
94 | 94 |
95 // Deletion flags: | 95 // Deletion flags: |
96 // Only delete if the path refers to a file/non-directory (by default, will | 96 // Only delete if the path refers to a file/non-directory (by default, will |
97 // delete files and directories). | 97 // delete files and directories). |
98 const uint32 kDeleteFlagFileOnly = 0x1; | 98 const uint32 kDeleteFlagFileOnly = 0x1; |
99 // Only delete if the path refers to a directory. | 99 // Only delete if the path refers to a directory. |
100 const uint32 kDeleteFlagDirectoryOnly = 0x2; | 100 const uint32 kDeleteFlagDirectoryOnly = 0x2; |
101 // Recursively delete (neither of the two flags above may be specified). | 101 // Recursively delete (neither of the two flags above may be specified). |
102 const uint32 kDeleteFlagRecursive = 0x4; | 102 const uint32 kDeleteFlagRecursive = 0x4; |
OLD | NEW |