Android-cuttlefish cvd tool
Namespaces | Functions
files.cpp File Reference
#include "cuttlefish/common/libs/utils/files.h"
#include <dirent.h>
#include <fcntl.h>
#include <ftw.h>
#include <libgen.h>
#include <sched.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <array>
#include <cerrno>
#include <chrono>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <ios>
#include <iosfwd>
#include <memory>
#include <numeric>
#include <ostream>
#include <string>
#include <vector>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/macros.h>
#include <android-base/parseint.h>
#include <android-base/strings.h>
#include <android-base/unique_fd.h>
#include "cuttlefish/common/libs/fs/shared_buf.h"
#include "cuttlefish/common/libs/fs/shared_fd.h"
#include "cuttlefish/common/libs/utils/contains.h"
#include "cuttlefish/common/libs/utils/in_sandbox.h"
#include "cuttlefish/common/libs/utils/result.h"
#include "cuttlefish/common/libs/utils/users.h"
Include dependency graph for files.cpp:

Namespaces

namespace  cuttlefish
 
namespace  cuttlefish::anonymous_namespace{files.cpp}
 

Functions

bool cuttlefish::FileExists (const std::string &path, bool follow_symlinks)
 
Result< dev_t > cuttlefish::FileDeviceId (const std::string &path)
 
Result< bool > cuttlefish::CanHardLink (const std::string &source, const std::string &destination)
 
Result< ino_t > cuttlefish::FileInodeNumber (const std::string &path)
 
Result< bool > cuttlefish::AreHardLinked (const std::string &source, const std::string &destination)
 
Result< std::string > cuttlefish::CreateHardLink (const std::string &target, const std::string &hardlink, const bool overwrite_existing)
 
Result< void > cuttlefish::CreateSymLink (const std::string &target, const std::string &link, const bool overwrite_existing)
 
bool cuttlefish::FileHasContent (const std::string &path)
 
Result< void > cuttlefish::HardLinkDirecoryContentsRecursively (const std::string &source, const std::string &destination)
 
Result< void > cuttlefish::MoveDirectoryContents (const std::string &source, const std::string &destination)
 
Result< std::vector< std::string > > cuttlefish::DirectoryContents (const std::string &path)
 
Result< std::vector< std::string > > cuttlefish::DirectoryContentsPaths (const std::string &path)
 
bool cuttlefish::DirectoryExists (const std::string &path, bool follow_symlinks)
 
Result< void > cuttlefish::EnsureDirectoryExists (const std::string &directory_path, const mode_t mode, const std::string &group_name)
 
Result< void > cuttlefish::ChangeGroup (const std::string &path, const std::string &group_name)
 
bool cuttlefish::CanAccess (const std::string &path, const int mode)
 
bool cuttlefish::IsDirectoryEmpty (const std::string &path)
 
Result< void > cuttlefish::RecursivelyRemoveDirectory (const std::string &path)
 
bool cuttlefish::anonymous_namespace{files.cpp}::SendFile (int out_fd, int in_fd, off64_t *offset, size_t count)
 
bool cuttlefish::Copy (const std::string &from, const std::string &to)
 
std::string cuttlefish::AbsolutePath (const std::string &path)
 
off_t cuttlefish::FileSize (const std::string &path)
 
bool cuttlefish::MakeFileExecutable (const std::string &path)
 
Result< std::chrono::system_clock::time_point > cuttlefish::FileModificationTime (const std::string &path)
 
Result< std::string > cuttlefish::RenameFile (const std::string &current_filepath, const std::string &target_filepath)
 
bool cuttlefish::RemoveFile (const std::string &file)
 
std::string cuttlefish::ReadFile (const std::string &file)
 
Result< std::string > cuttlefish::ReadFileContents (const std::string &filepath)
 
std::string cuttlefish::CurrentDirectory ()
 
FileSizes cuttlefish::SparseFileSizes (const std::string &path)
 
bool cuttlefish::FileIsSocket (const std::string &path)
 
std::string cuttlefish::FindImage (const std::string &search_path, const std::vector< std::string > &pattern)
 
Result< std::string > cuttlefish::FindFile (const std::string &path, const std::string &target_name)
 
Result< void > cuttlefish::WalkDirectory (const std::string &dir, const std::function< bool(const std::string &)> &callback)
 
std::vector< std::string > cuttlefish::anonymous_namespace{files.cpp}::FoldPath (std::vector< std::string > elements, std::string token)
 
Result< std::vector< std::string > > cuttlefish::anonymous_namespace{files.cpp}::CalculatePrefix (const InputPathForm &path_info)
 
Result< std::string > cuttlefish::EmulateAbsolutePath (const InputPathForm &path_info)