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 module filesystem; | 5 module filesystem; |
6 | 6 |
7 import "components/filesystem/public/interfaces/file.mojom"; | 7 import "components/filesystem/public/interfaces/file.mojom"; |
8 import "components/filesystem/public/interfaces/types.mojom"; | 8 import "components/filesystem/public/interfaces/types.mojom"; |
9 | 9 |
10 // This interface provides access to a directory in a "file system", providing | 10 // This interface provides access to a directory in a "file system", providing |
(...skipping 24 matching lines...) Expand all Loading... |
35 Directory&? directory, | 35 Directory&? directory, |
36 uint32 open_flags) => (FileError error); | 36 uint32 open_flags) => (FileError error); |
37 | 37 |
38 // Renames/moves the file/directory given by |path| to |new_path|. | 38 // Renames/moves the file/directory given by |path| to |new_path|. |
39 Rename(string path, string new_path) => (FileError error); | 39 Rename(string path, string new_path) => (FileError error); |
40 | 40 |
41 // Deletes the given path, which may be a file or a directory (see | 41 // Deletes the given path, which may be a file or a directory (see |
42 // |kDeleteFlag...| for details). | 42 // |kDeleteFlag...| for details). |
43 Delete(string path, uint32 delete_flags) => (FileError error); | 43 Delete(string path, uint32 delete_flags) => (FileError error); |
44 | 44 |
| 45 // Returns true if |path| exists. |
| 46 Exists(string path) => (FileError error, bool exists); |
| 47 |
| 48 // Returns true if |path| is writable. |
| 49 IsWritable(string path) => (FileError error, bool is_writable); |
| 50 |
| 51 // Opens a file descriptor on this directory and calls |
| 52 // fsync()/FlushFileBuffers(). |
| 53 Flush() => (FileError error); |
| 54 |
45 // TODO(vtl): directory "streaming"? | 55 // TODO(vtl): directory "streaming"? |
46 // TODO(vtl): "make root" (i.e., prevent cd-ing, etc., to parent); note that | 56 // TODO(vtl): "make root" (i.e., prevent cd-ing, etc., to parent); note that |
47 // this would require a much more complicated implementation (e.g., it needs | 57 // this would require a much more complicated implementation (e.g., it needs |
48 // to be "inherited" by OpenDirectory(), and the enforcement needs to be valid | 58 // to be "inherited" by OpenDirectory(), and the enforcement needs to be valid |
49 // even if the opened directory is subsequently moved -- e.g., closer to the | 59 // even if the opened directory is subsequently moved -- e.g., closer to the |
50 // "root") | 60 // "root") |
51 // TODO(vtl): Add a "watch"? | 61 // TODO(vtl): Add a "watch"? |
52 }; | 62 }; |
OLD | NEW |