OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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 #ifndef CHROMECAST_BASE_FILE_UTILS_H_ | |
6 #define CHROMECAST_BASE_FILE_UTILS_H_ | |
7 | |
8 #include "base/files/file_path.h" | |
9 | |
10 namespace chromecast { | |
11 | |
12 // Lock a file (blocking request) with filepath |path|. Returns the file | |
13 // descriptor on success, an invalid file descriptor (-1) on failure. Failure | |
14 // indicates that |path| does not exist, or the locking procedure failed. | |
15 int OpenAndLockFile(const base::FilePath& path); | |
slan
2016/08/08 16:37:10
What is the expectation if the file does not exist
ameyak
2016/08/08 18:00:43
Returns invalid file descriptor (-1)
slan
2016/08/08 18:32:19
Oh, it's right there in the comment.
https://i.yt
| |
16 | |
17 // Unlock a file (blocking request) denoted by file descriptor |fd|. Returns | |
18 // true on success, false on failure. | |
19 bool UnlockAndCloseFile(const int fd); | |
20 | |
21 } // namespace chromecast | |
22 | |
23 #endif // CHROMECAST_BASE_FILE_UTILS_H_ | |
OLD | NEW |