Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: runtime/bin/file.dart

Issue 8679005: Add truncate operation to File API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file.cc ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.dart
diff --git a/runtime/bin/file.dart b/runtime/bin/file.dart
index ae674811a09c5be0ee3c0b35ebb1d05a5c5d71c2..d569562b29873ea1b3904f310d1bc5cd4296895b 100644
--- a/runtime/bin/file.dart
+++ b/runtime/bin/file.dart
@@ -160,6 +160,17 @@ interface File factory _File {
void setPositionSync(int position);
/**
+ * Truncate (or extend) the file to [length] bytes. When the
+ * operation completes successfully the [truncateHandler] is called.
+ */
+ void truncate(int length);
+
+ /**
+ * Synchronously truncate (or extend) the file to [length] bytes.
+ */
+ void truncateSync(int length);
+
+ /**
* Get the length of the file. When the operation completes the
* [lengthHandler] is called with the length.
*/
@@ -222,6 +233,7 @@ interface File factory _File {
void set noPendingWriteHandler(void handler());
void set positionHandler(void handler(int position));
void set setPositionHandler(void handler());
+ void set truncateHandler(void handler());
void set lengthHandler(void handler(int length));
void set flushHandler(void handler());
void set fullPathHandler(void handler(String path));
« no previous file with comments | « runtime/bin/file.cc ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698