Android-cuttlefish cvd tool
Namespaces | Functions
files.cpp File Reference
#include "cuttlefish/common/libs/utils/files.h"
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <chrono>
#include <fstream>
#include <ios>
#include <iosfwd>
#include <string>
#include <string_view>
#include <vector>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_split.h"
#include "android-base/file.h"
#include "fmt/format.h"
#include "cuttlefish/common/libs/fs/fd.h"
#include "cuttlefish/common/libs/fs/shared_buf.h"
#include "cuttlefish/common/libs/fs/shared_fd.h"
#include "cuttlefish/common/libs/utils/environment.h"
#include "cuttlefish/common/libs/utils/in_sandbox.h"
#include "cuttlefish/common/libs/utils/users.h"
#include "cuttlefish/files/copy.h"
#include "cuttlefish/files/directory_contents.h"
#include "cuttlefish/files/directory_exists.h"
#include "cuttlefish/files/file_device_id.h"
#include "cuttlefish/files/file_exists.h"
#include "cuttlefish/files/link_or_copy.h"
#include "cuttlefish/io/string.h"
#include "cuttlefish/posix/realpath.h"
#include "cuttlefish/posix/remove.h"
#include "cuttlefish/posix/rename.h"
#include "cuttlefish/posix/stat.h"
#include "cuttlefish/posix/strerror.h"
#include "cuttlefish/result/result.h"
Include dependency graph for files.cpp:

Namespaces

namespace  cuttlefish
 

Functions

Result< bool > cuttlefish::CanHardLink (const std::string &source, const std::string &destination)
 
bool cuttlefish::FileHasContent (const std::string &path)
 
Result< void > cuttlefish::LinkOrCopyDirectoryContentsRecursively (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::DirectoryContentsPaths (const std::string &path)
 
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)
 
std::string cuttlefish::AbsolutePath (std::string_view path)
 
off_t cuttlefish::FileSize (const std::string &path)
 
Result< uid_t > cuttlefish::FileOwner (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)
 
std::string cuttlefish::ReadFile (const std::string &file)
 
Result< std::string > cuttlefish::ReadFileContents (const std::string &path)
 
Result< void > cuttlefish::WriteNewFile (const std::string &filepath, std::string_view content, mode_t mode)
 
std::string cuttlefish::CurrentDirectory ()
 
FileSizes cuttlefish::SparseFileSizes (const std::string &path)
 
Result< std::string > cuttlefish::FindFile (const std::string &path, const std::string &target_name)
 
Result< void > cuttlefish::WalkDirectory (const std::string &dir, const WalkDirectoryCallback &callback)
 
std::vector< std::string > cuttlefish::Path (const std::string &env_name)
 
Result< std::string > cuttlefish::Search (const std::vector< std::string > &path, std::string_view name)
 
Result< SharedFD > cuttlefish::CreateOrReuseAndDrainFifo (const std::string &path, mode_t mode)