OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 /** | 7 /** |
8 * The modes in which a File can be opened. | 8 * The modes in which a File can be opened. |
9 */ | 9 */ |
10 class FileMode { | 10 class FileMode { |
(...skipping 16 matching lines...) Expand all Loading... |
27 /// The mode for opening a file for reading and writing. The file is | 27 /// The mode for opening a file for reading and writing. The file is |
28 /// overwritten if it already exists. The file is created if it does not | 28 /// overwritten if it already exists. The file is created if it does not |
29 /// already exist. | 29 /// already exist. |
30 const WRITE = FileMode.WRITE; | 30 const WRITE = FileMode.WRITE; |
31 /// The mode for opening a file for reading and writing to the | 31 /// The mode for opening a file for reading and writing to the |
32 /// end of it. The file is created if it does not already exist. | 32 /// end of it. The file is created if it does not already exist. |
33 const APPEND = FileMode.APPEND; | 33 const APPEND = FileMode.APPEND; |
34 | 34 |
35 | 35 |
36 /// Type of lock when requesting a lock on a file. | 36 /// Type of lock when requesting a lock on a file. |
37 class FileLock { | 37 enum FileLock { |
38 final int _lock; | |
39 | |
40 /// Shared file lock. | 38 /// Shared file lock. |
41 static const SHARED = const FileLock._internal(0); | 39 SHARED, |
42 | |
43 /// Exclusive file lock. | 40 /// Exclusive file lock. |
44 static const EXCLUSIVE = const FileLock._internal(1); | 41 EXCLUSIVE |
45 | |
46 const FileLock._internal(this._lock); | |
47 } | 42 } |
48 | 43 |
49 /** | 44 /** |
50 * A reference to a file on the file system. | 45 * A reference to a file on the file system. |
51 * | 46 * |
52 * A File instance is an object that holds a [path] on which operations can | 47 * A File instance is an object that holds a [path] on which operations can |
53 * be performed. | 48 * be performed. |
54 * You can get the parent directory of the file using the getter [parent], | 49 * You can get the parent directory of the file using the getter [parent], |
55 * a property inherited from [FileSystemEntity]. | 50 * a property inherited from [FileSystemEntity]. |
56 * | 51 * |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 sb.write(": $osError"); | 861 sb.write(": $osError"); |
867 if (path != null) { | 862 if (path != null) { |
868 sb.write(", path = '$path'"); | 863 sb.write(", path = '$path'"); |
869 } | 864 } |
870 } else if (path != null) { | 865 } else if (path != null) { |
871 sb.write(": $path"); | 866 sb.write(": $path"); |
872 } | 867 } |
873 return sb.toString(); | 868 return sb.toString(); |
874 } | 869 } |
875 } | 870 } |
OLD | NEW |