Disable buffering in asan_symbolize.py
[chromium-blink-merge.git] / base / file_util_mac.mm
blobf8a6b6301f5104a4b1d760a735b1a0949683a10e
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
3 // found in the LICENSE file.
5 #include "base/file_util.h"
7 #import <Foundation/Foundation.h>
8 #include <copyfile.h>
10 #include "base/basictypes.h"
11 #include "base/files/file_path.h"
12 #include "base/mac/foundation_util.h"
13 #include "base/strings/string_util.h"
14 #include "base/threading/thread_restrictions.h"
16 namespace base {
17 namespace internal {
19 bool CopyFileUnsafe(const FilePath& from_path, const FilePath& to_path) {
20   ThreadRestrictions::AssertIOAllowed();
21   return (copyfile(from_path.value().c_str(),
22                    to_path.value().c_str(), NULL, COPYFILE_ALL) == 0);
25 }  // namespace internal
27 bool GetTempDir(base::FilePath* path) {
28   NSString* tmp = NSTemporaryDirectory();
29   if (tmp == nil)
30     return false;
31   *path = base::mac::NSStringToFilePath(tmp);
32   return true;
35 bool GetShmemTempDir(bool executable, base::FilePath* path) {
36   return GetTempDir(path);
39 }  // namespace base