| Index: runtime/bin/file_linux.cc
|
| diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
|
| index d0c2c5329cb6a9bea498ce886e88439c6a81c392..6da08185133bf283e98961d96f324d8a2b1ebf8b 100644
|
| --- a/runtime/bin/file_linux.cc
|
| +++ b/runtime/bin/file_linux.cc
|
| @@ -91,7 +91,7 @@ off_t File::Length() {
|
| }
|
|
|
|
|
| -File* File::OpenFile(const char* name, bool writable) {
|
| +File* File::Open(const char* name, bool writable) {
|
| int flags = O_RDONLY;
|
| if (writable) {
|
| flags = (O_RDWR | O_CREAT | O_TRUNC);
|
| @@ -104,7 +104,7 @@ File* File::OpenFile(const char* name, bool writable) {
|
| }
|
|
|
|
|
| -bool File::FileExists(const char* name) {
|
| +bool File::Exists(const char* name) {
|
| struct stat st;
|
| if (stat(name, &st) == 0) {
|
| return S_ISREG(st.st_mode); // Deal with symlinks?
|
| @@ -114,6 +114,15 @@ bool File::FileExists(const char* name) {
|
| }
|
|
|
|
|
| +bool File::Create(const char* name) {
|
| + int fd = open(name, O_RDONLY | O_CREAT, 0666);
|
| + if (fd < 0) {
|
| + return false;
|
| + }
|
| + return (close(fd) == 0);
|
| +}
|
| +
|
| +
|
| bool File::IsAbsolutePath(const char* pathname) {
|
| return (pathname != NULL && pathname[0] == '/');
|
| }
|
|
|