summaryrefslogtreecommitdiffstats
path: root/base/platform_file.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/platform_file.h')
-rw-r--r--base/platform_file.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/base/platform_file.h b/base/platform_file.h
index 0e4d05c..802102c 100644
--- a/base/platform_file.h
+++ b/base/platform_file.h
@@ -6,7 +6,9 @@
#define BASE_PLATFORM_FILE_H_
#pragma once
+#include "base/basictypes.h"
#include "build/build_config.h"
+#include "base/time.h"
#if defined(OS_WIN)
#include <windows.h>
#endif
@@ -55,6 +57,28 @@ enum PlatformFileError {
PLATFORM_FILE_ERROR_INVALID_OPERATION = -10
};
+// Used to hold information about a given file.
+// If you add more fields to this structure (platform-specific fields are OK),
+// make sure to update all functions that use it in file_util_{win|posix}.cc
+// too, and the ParamTraits<base::PlatformFileInfo> implementation in
+// chrome/common/common_param_traits.cc.
+struct PlatformFileInfo {
+ // The size of the file in bytes. Undefined when is_directory is true.
+ int64 size;
+
+ // True if the file corresponds to a directory.
+ bool is_directory;
+
+ // The last modified time of a file.
+ base::Time last_modified;
+
+ // The last accessed time of a file.
+ base::Time last_accessed;
+
+ // The creation time of a file.
+ base::Time creation_time;
+};
+
// Creates or opens the given file. If PLATFORM_FILE_OPEN_ALWAYS is used, and
// |created| is provided, |created| will be set to true if the file was created
// or to false in case the file was just opened. |error_code| can be NULL.