Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fileutils.cc File Reference
#include "ion/port/fileutils.h"
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cstdlib>
#include <cassert>
#include "base/integral_types.h"
#include "ion/port/string.h"
Include dependency graph for fileutils.cc:

Go to the source code of this file.

Namespaces

 ion
 Copyright 2016 Google Inc.
 
 ion::port
 

Functions

std::string ion::port::GetCanonicalFilePath (const std::string &path)
 Returns a canonical version of a file path string. More...
 
std::string ion::port::GetCurrentWorkingDirectory ()
 Returns a platform-dependent string that is the current working directory. More...
 
bool ion::port::GetFileModificationTime (const std::string &path, std::chrono::system_clock::time_point *time)
 Reads the last modification time of the passed file path into time and returns true, iff the file exists. More...
 
std::string ion::port::GetTemporaryDirectory ()
 Returns a platform-dependent string that names the temporary directory. More...
 
std::string ion::port::GetTemporaryFilename ()
 Returns a platform-dependent string that names a valid filename which may be opened for reading or writing. More...
 
FILE * ion::port::OpenFile (const std::string &path, const std::string &mode)
 Opens the file at path and returns a FILE pointer suitable for passing to fread, fwrite, fclose, etc. More...
 
bool ion::port::ReadDataFromFile (const std::string &path, std::string *out)
 Opens the file at path and read the contents of the file into a string. More...
 
bool ion::port::RemoveFile (const std::string &path)
 Attempts to remove the file at path and returns whether the file was successfully removed. More...
 
std::vector< std::string > ion::port::ListDirectory (const std::string &path)
 Returns the contents of path, non-recursively. More...