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

Unified Diff: base/file_util.h

Issue 165085: Define _FILE_OFFSET_BITS=64 in order to support large files (>2GB).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 4 months 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 | base/file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.h
===================================================================
--- base/file_util.h (revision 22661)
+++ base/file_util.h (working copy)
@@ -13,10 +13,7 @@
#if defined(OS_WIN)
#include <windows.h>
#elif defined(OS_POSIX)
-// Keep the order as in fts(3): fts.h requires types defined in sys/types.h
-#include <sys/types.h>
#include <sys/stat.h>
-#include <fts.h>
#endif
#include <stdio.h>
@@ -421,6 +418,9 @@
FILES = 1 << 0,
DIRECTORIES = 1 << 1,
INCLUDE_DOT_DOT = 1 << 2,
+#if defined(OS_POSIX)
+ SHOW_SYM_LINKS = 1 << 4,
+#endif
};
// |root_path| is the starting directory to search for. It may or may not end
@@ -485,8 +485,24 @@
WIN32_FIND_DATA find_data_;
HANDLE find_handle_;
#elif defined(OS_POSIX)
- FTS* fts_;
- FTSENT* fts_ent_;
+ typedef struct {
+ FilePath filename;
+ struct stat stat;
+ } DirectoryEntryInfo;
+
+ // Read the filenames in source into the vector of DirectoryEntryInfo's
+ static bool ReadDirectory(std::vector<DirectoryEntryInfo>* entries,
+ const FilePath& source, bool show_links);
+
+ // Comparison function to neatly sort directory entries
+ static bool CompareFiles(const DirectoryEntryInfo& a,
+ const DirectoryEntryInfo& b);
+
+ // The files in the current directory
+ std::vector<DirectoryEntryInfo> directory_entries_;
+
+ // The next entry to use from the directory_entries_ vector
+ size_t current_directory_entry_;
#endif
DISALLOW_EVIL_CONSTRUCTORS(FileEnumerator);
« no previous file with comments | « no previous file | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698