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

Unified Diff: runtime/bin/file.h

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/builtin_in.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.h
diff --git a/runtime/bin/file.h b/runtime/bin/file.h
index 382adffa7b760320cd7b11d41bfd0ea470831a94..239544774e7c33de3ae2983e39d7881a8978f86d 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -46,7 +46,12 @@ class File {
// Get the current position in the file.
// Returns a negative value if position cannot be determined.
off_t Position();
- off_t SetPosition(int64_t position);
+
+ // Set the byte position in the file.
+ bool SetPosition(int64_t position);
+
+ // Truncate (or extend) the file to the given length in bytes.
+ bool Truncate(int64_t length);
// Flush contents of file.
void Flush();
« no previous file with comments | « runtime/bin/builtin_in.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698