Android-cuttlefish cvd tool
Classes | Namespaces | Macros | Functions
file.h File Reference
#include <sys/stat.h>
#include <sys/types.h>
#include <string>
#include "android-base/macros.h"
#include "android-base/off64_t.h"
#include "android-base/unique_fd.h"
Include dependency graph for file.h:

Go to the source code of this file.

Classes

class  TemporaryFile
 
class  TemporaryDir
 

Namespaces

namespace  android
 
namespace  android::base
 

Macros

#define O_BINARY   0
 

Functions

bool android::base::ReadFdToString (borrowed_fd fd, std::string *content)
 
bool android::base::ReadFileToString (const std::string &path, std::string *content, bool follow_symlinks)
 
bool android::base::WriteStringToFile (const std::string &content, const std::string &path, bool follow_symlinks)
 
bool android::base::WriteStringToFd (std::string_view content, borrowed_fd fd)
 
bool android::base::WriteStringToFile (const std::string &content, const std::string &path, mode_t mode, uid_t owner, gid_t group, bool follow_symlinks)
 
bool android::base::ReadFully (borrowed_fd fd, void *data, size_t byte_count)
 
bool android::base::ReadFullyAtOffset (borrowed_fd fd, void *data, size_t byte_count, off64_t offset)
 
bool android::base::WriteFully (borrowed_fd fd, const void *data, size_t byte_count)
 
bool android::base::WriteFullyAtOffset (borrowed_fd fd, const void *data, size_t byte_count, off64_t offset)
 
bool android::base::RemoveFileIfExists (const std::string &path, std::string *err)
 
bool android::base::Realpath (const std::string &path, std::string *result)
 
bool android::base::Readlink (const std::string &path, std::string *result)
 
std::string android::base::GetExecutablePath ()
 
std::string android::base::GetExecutableDirectory ()
 
std::string android::base::Basename (std::string_view path)
 
std::string android::base::Dirname (std::string_view path)
 

Macro Definition Documentation

◆ O_BINARY

#define O_BINARY   0

Windows needs O_BINARY, but Unix never mangles line endings.