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

Unified Diff: runtime/bin/directory_android.cc

Issue 63363010: Add support for working with large files, in dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | runtime/bin/directory_linux.cc » ('j') | runtime/bin/file_android.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_android.cc
diff --git a/runtime/bin/directory_android.cc b/runtime/bin/directory_android.cc
index 02f841deb3321318fc8ad505a82cb2bec7f94149..cc5433744ec4179f1abb1d1e11a77132afeb7e3d 100644
--- a/runtime/bin/directory_android.cc
+++ b/runtime/bin/directory_android.cc
@@ -129,10 +129,10 @@ ListType DirectoryListingEntry::Next(DirectoryListing* listing) {
// readdir_r. For those and for links we use stat to determine
// the actual entry type. Notice that stat returns the type of
// the file pointed to.
- struct stat entry_info;
+ struct stat64 entry_info;
int stat_success;
stat_success = TEMP_FAILURE_RETRY(
- lstat(listing->path_buffer().AsString(), &entry_info));
+ lstat64(listing->path_buffer().AsString(), &entry_info));
if (stat_success == -1) {
return kListError;
}
@@ -151,7 +151,7 @@ ListType DirectoryListingEntry::Next(DirectoryListing* listing) {
previous = previous->next;
}
stat_success = TEMP_FAILURE_RETRY(
- stat(listing->path_buffer().AsString(), &entry_info));
+ stat64(listing->path_buffer().AsString(), &entry_info));
if (stat_success == -1) {
// Report a broken link as a link, even if follow_links is true.
return kListLink;
@@ -230,8 +230,8 @@ static bool DeleteDir(char* dir_name,
static bool DeleteRecursively(PathBuffer* path) {
// Do not recurse into links for deletion. Instead delete the link.
// If it's a file, delete it.
- struct stat st;
- if (TEMP_FAILURE_RETRY(lstat(path->AsString(), &st)) == -1) {
+ struct stat64 st;
+ if (TEMP_FAILURE_RETRY(lstat64(path->AsString(), &st)) == -1) {
return false;
} else if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {
return (unlink(path->AsString()) == 0);
@@ -276,13 +276,13 @@ static bool DeleteRecursively(PathBuffer* path) {
// On some file systems the entry type is not determined by
// readdir_r. For those we use lstat to determine the entry
// type.
- struct stat entry_info;
+ struct stat64 entry_info;
if (!path->Add(entry.d_name)) {
success = false;
break;
}
int lstat_success = TEMP_FAILURE_RETRY(
- lstat(path->AsString(), &entry_info));
+ lstat64(path->AsString(), &entry_info));
if (lstat_success == -1) {
success = false;
break;
@@ -314,8 +314,8 @@ static bool DeleteRecursively(PathBuffer* path) {
Directory::ExistsResult Directory::Exists(const char* dir_name) {
- struct stat entry_info;
- int success = TEMP_FAILURE_RETRY(stat(dir_name, &entry_info));
+ struct stat64 entry_info;
+ int success = TEMP_FAILURE_RETRY(stat64(dir_name, &entry_info));
if (success == 0) {
if (S_ISDIR(entry_info.st_mode)) {
return EXISTS;
@@ -395,8 +395,8 @@ char* Directory::SystemTemp() {
// probably use the appropriate directory from the Android API,
// probably what File.createTempFile uses.
#define ANDROID_TEMP_DIR "/data/local/tmp"
- struct stat st;
- if (stat(ANDROID_TEMP_DIR, &st) != 0) {
+ struct stat64 st;
+ if (stat64(ANDROID_TEMP_DIR, &st) != 0) {
mkdir(ANDROID_TEMP_DIR, 0777);
}
return strdup(ANDROID_TEMP_DIR);
« no previous file with comments | « no previous file | runtime/bin/directory_linux.cc » ('j') | runtime/bin/file_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698