OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 | 117 |
118 LOG(LS_INFO) << "Creating folder: " << pathname; | 118 LOG(LS_INFO) << "Creating folder: " << pathname; |
119 return (0 == ::mkdir(pathname.c_str(), mode)); | 119 return (0 == ::mkdir(pathname.c_str(), mode)); |
120 } | 120 } |
121 | 121 |
122 bool UnixFilesystem::CreateFolder(const Pathname &path) { | 122 bool UnixFilesystem::CreateFolder(const Pathname &path) { |
123 return CreateFolder(path, 0755); | 123 return CreateFolder(path, 0755); |
124 } | 124 } |
125 | 125 |
126 FileStream *UnixFilesystem::OpenFile(const Pathname &filename, | |
127 const std::string &mode) { | |
128 FileStream *fs = new FileStream(); | |
129 if (fs && !fs->Open(filename.pathname().c_str(), mode.c_str(), nullptr)) { | |
130 delete fs; | |
131 fs = nullptr; | |
132 } | |
133 return fs; | |
134 } | |
135 | |
136 bool UnixFilesystem::DeleteFile(const Pathname &filename) { | 126 bool UnixFilesystem::DeleteFile(const Pathname &filename) { |
137 LOG(LS_INFO) << "Deleting file:" << filename.pathname(); | 127 LOG(LS_INFO) << "Deleting file:" << filename.pathname(); |
138 | 128 |
139 if (!IsFile(filename)) { | 129 if (!IsFile(filename)) { |
140 RTC_DCHECK(IsFile(filename)); | 130 RTC_DCHECK(IsFile(filename)); |
141 return false; | 131 return false; |
142 } | 132 } |
143 return ::unlink(filename.pathname().c_str()) == 0; | 133 return ::unlink(filename.pathname().c_str()) == 0; |
144 } | 134 } |
145 | 135 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 264 |
275 } // namespace rtc | 265 } // namespace rtc |
276 | 266 |
277 #if defined(__native_client__) | 267 #if defined(__native_client__) |
278 extern "C" int __attribute__((weak)) | 268 extern "C" int __attribute__((weak)) |
279 link(const char* oldpath, const char* newpath) { | 269 link(const char* oldpath, const char* newpath) { |
280 errno = EACCES; | 270 errno = EACCES; |
281 return -1; | 271 return -1; |
282 } | 272 } |
283 #endif | 273 #endif |
OLD | NEW |