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

Side by Side Diff: base/files/file_util.h

Issue 2086103002: Add base::ExecutableExistsInPath (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/files/file_util_posix.cc » ('j') | base/files/file_util_posix.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file contains utility functions for dealing with the local 5 // This file contains utility functions for dealing with the local
6 // filesystem. 6 // filesystem.
7 7
8 #ifndef BASE_FILES_FILE_UTIL_H_ 8 #ifndef BASE_FILES_FILE_UTIL_H_
9 #define BASE_FILES_FILE_UTIL_H_ 9 #define BASE_FILES_FILE_UTIL_H_
10 10
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 }; 192 };
193 193
194 // Reads the permission of the given |path|, storing the file permission 194 // Reads the permission of the given |path|, storing the file permission
195 // bits in |mode|. If |path| is symbolic link, |mode| is the permission of 195 // bits in |mode|. If |path| is symbolic link, |mode| is the permission of
196 // a file which the symlink points to. 196 // a file which the symlink points to.
197 BASE_EXPORT bool GetPosixFilePermissions(const FilePath& path, int* mode); 197 BASE_EXPORT bool GetPosixFilePermissions(const FilePath& path, int* mode);
198 // Sets the permission of the given |path|. If |path| is symbolic link, sets 198 // Sets the permission of the given |path|. If |path| is symbolic link, sets
199 // the permission of a file which the symlink points to. 199 // the permission of a file which the symlink points to.
200 BASE_EXPORT bool SetPosixFilePermissions(const FilePath& path, int mode); 200 BASE_EXPORT bool SetPosixFilePermissions(const FilePath& path, int mode);
201 201
202 // Returns true iff |executable| can be found in any directory specified by the
203 // $PATH environment variable.
204 BASE_EXPORT bool ExecutableExistsInPath(const char* executable);
Lei Zhang 2016/06/21 21:31:21 Use a StringPiece
Tom (Use chromium acct) 2016/06/22 16:57:55 Used FilePath::StringType instead, as this is what
Lei Zhang 2016/06/23 19:17:05 Ya, that's fine.
205
202 #endif // OS_POSIX 206 #endif // OS_POSIX
203 207
204 // Returns true if the given directory is empty 208 // Returns true if the given directory is empty
205 BASE_EXPORT bool IsDirectoryEmpty(const FilePath& dir_path); 209 BASE_EXPORT bool IsDirectoryEmpty(const FilePath& dir_path);
206 210
207 // Get the temporary directory provided by the system. 211 // Get the temporary directory provided by the system.
208 // 212 //
209 // WARNING: In general, you should use CreateTemporaryFile variants below 213 // WARNING: In general, you should use CreateTemporaryFile variants below
210 // instead of this function. Those variants will ensure that the proper 214 // instead of this function. Those variants will ensure that the proper
211 // permissions are set so that other users on the system can't edit them while 215 // permissions are set so that other users on the system can't edit them while
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // This function simulates Move(), but unlike Move() it works across volumes. 439 // This function simulates Move(), but unlike Move() it works across volumes.
436 // This function is not transactional. 440 // This function is not transactional.
437 BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path, 441 BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path,
438 const FilePath& to_path); 442 const FilePath& to_path);
439 #endif // defined(OS_WIN) 443 #endif // defined(OS_WIN)
440 444
441 } // namespace internal 445 } // namespace internal
442 } // namespace base 446 } // namespace base
443 447
444 #endif // BASE_FILES_FILE_UTIL_H_ 448 #endif // BASE_FILES_FILE_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | base/files/file_util_posix.cc » ('j') | base/files/file_util_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698