OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 // | |
5 // File compatability routines. Useful to delete database files with. | |
6 | |
7 #ifndef CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ | |
8 #define CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ | |
9 | |
10 #include <fcntl.h> | |
11 #include <sys/stat.h> | |
12 #include <sys/types.h> | |
13 #include "chrome/browser/sync/util/sync_types.h" | |
14 | |
15 extern const PathChar* const kPathSeparator; | |
16 | |
17 // Path calls for all OSes. | |
18 // Returns 0 on success, non-zero on failure. | |
19 int PathRemove(const PathString& path); | |
20 | |
21 #ifdef OS_WINDOWS | |
22 inline int PathRemove(const PathString& path) { | |
23 return _wremove(path.c_str()); | |
24 } | |
25 #elif (defined(OS_MACOSX) || defined(OS_LINUX)) | |
26 inline int PathRemove(const PathString& path) { | |
27 return unlink(path.c_str()); | |
28 } | |
29 #endif | |
30 | |
31 #endif // CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ | |
OLD | NEW |