OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 module mojo.files; |
| 6 |
| 7 // Error codes used by the file manager. |
| 8 enum Error { |
| 9 OK = 0, |
| 10 UNKNOWN, |
| 11 INVALID_ARGUMENT, |
| 12 PERMISSION_DENIED, |
| 13 OUT_OF_RANGE, |
| 14 UNIMPLEMENTED, |
| 15 CLOSED, |
| 16 UNAVAILABLE, |
| 17 INTERNAL, |
| 18 }; |
| 19 |
| 20 enum Whence { |
| 21 FROM_CURRENT, |
| 22 FROM_START, |
| 23 FROM_END, |
| 24 }; |
| 25 |
| 26 struct FileTimes { |
| 27 int64 atime; |
| 28 int64 mtime; |
| 29 }; |
| 30 |
| 31 struct FileInformation { |
| 32 int64 size; |
| 33 FileTimes? times; |
| 34 }; |
| 35 |
| 36 const uint32 kAccessFlagRead = 0x1; |
| 37 const uint32 kAccessFlagWrite = 0x2; |
| 38 |
| 39 //FIXME only affects "write" |
| 40 const uint32 kOpenFlagCreate = 0x1; |
| 41 //FIXME only meaningful with "create" |
| 42 const uint32 kOpenFlagExclusive = 0x2; |
| 43 const uint32 kOpenFlagAppend = 0x4; |
| 44 const uint32 kOpenFlagTruncate = 0x8; |
| 45 |
| 46 enum FileType { |
| 47 UNKNOWN, |
| 48 REGULAR_FILE, |
| 49 DIRECTORY, |
| 50 }; |
| 51 |
| 52 struct DirectoryEntry { |
| 53 FileType type; |
| 54 string name; |
| 55 }; |
OLD | NEW |