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

Side by Side Diff: base/platform_file_posix.cc

Issue 5349007: Some additions to support symlinks better on platforms that support them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removing TODO Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/platform_file.h ('k') | base/platform_file_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/platform_file.h" 5 #include "base/platform_file.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 10
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info) { 181 bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info) {
182 if (!info) 182 if (!info)
183 return false; 183 return false;
184 184
185 stat_wrapper_t file_info; 185 stat_wrapper_t file_info;
186 if (CallFstat(file, &file_info)) 186 if (CallFstat(file, &file_info))
187 return false; 187 return false;
188 188
189 info->is_directory = S_ISDIR(file_info.st_mode); 189 info->is_directory = S_ISDIR(file_info.st_mode);
190 info->is_symbolic_link = S_ISLNK(file_info.st_mode);
190 info->size = file_info.st_size; 191 info->size = file_info.st_size;
191 info->last_modified = base::Time::FromTimeT(file_info.st_mtime); 192 info->last_modified = base::Time::FromTimeT(file_info.st_mtime);
192 info->last_accessed = base::Time::FromTimeT(file_info.st_atime); 193 info->last_accessed = base::Time::FromTimeT(file_info.st_atime);
193 info->creation_time = base::Time::FromTimeT(file_info.st_ctime); 194 info->creation_time = base::Time::FromTimeT(file_info.st_ctime);
194 return true; 195 return true;
195 } 196 }
196 197
197 } // namespace base 198 } // namespace base
OLDNEW
« no previous file with comments | « base/platform_file.h ('k') | base/platform_file_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698