OmniSciDB
a5dc49c757
|
A selection of helper methods for File I/O. More...
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <string>
#include "Shared/types.h"
Go to the source code of this file.
Namespaces | |
File_Namespace | |
Macros | |
#define | DATA_FILE_EXT ".data" |
Functions | |
std::string | File_Namespace::get_data_file_path (const std::string &base_path, int file_id, size_t page_size) |
std::string | File_Namespace::get_legacy_data_file_path (const std::string &new_data_file_path) |
std::pair< FILE *, std::string > | File_Namespace::create (const std::string &basePath, const int fileId, const size_t pageSize, const size_t numPages) |
FILE * | File_Namespace::create (const std::string &full_path, const size_t requested_file_size) |
Opens/creates a file with the given path and file size. Fatal crash if file can not be created to required size. More... | |
FILE * | File_Namespace::open (int file_id) |
Opens the file with the given id; fatal crash on error. More... | |
FILE * | File_Namespace::open (const std::string &path) |
void | File_Namespace::close (FILE *f) |
Closes the file pointed to by the FILE pointer. More... | |
bool | File_Namespace::removeFile (const std::string &basePath, const std::string &filename) |
Deletes the file pointed to by the FILE pointer. More... | |
size_t | File_Namespace::read (FILE *f, const size_t offset, const size_t size, int8_t *buf, const std::string &file_path) |
Reads the specified number of bytes from the offset position in file f into buf. More... | |
size_t | File_Namespace::write (FILE *f, const size_t offset, const size_t size, const int8_t *buf) |
Writes the specified number of bytes to the offset position in file f from buf. More... | |
size_t | File_Namespace::append (FILE *f, const size_t size, const int8_t *buf) |
Appends the specified number of bytes to the end of the file f from buf. More... | |
size_t | File_Namespace::readPage (FILE *f, const size_t pageSize, const size_t pageNum, int8_t *buf, const std::string &file_path) |
Reads the specified page from the file f into buf. More... | |
size_t | File_Namespace::writePage (FILE *f, const size_t pageSize, const size_t pageNum, int8_t *buf) |
Writes a page from buf to the file. More... | |
size_t | File_Namespace::appendPage (FILE *f, const size_t pageSize, int8_t *buf) |
Appends a page from buf to the file. More... | |
size_t | File_Namespace::fileSize (FILE *f) |
Returns the size of the specified file. More... | |
void | File_Namespace::renameForDelete (const std::string directoryName) |
Renames a directory to DELETE_ME_<EPOCH>_<oldname>. More... | |
Variables | |
constexpr auto | File_Namespace::kLegacyDataFileExtension {".mapd"} |
A selection of helper methods for File I/O.
Definition in file File.h.
#define DATA_FILE_EXT ".data" |
Definition at line 25 of file File.h.
Referenced by anonymous_namespace{TableArchiver.cpp}::add_data_file_symlinks(), File_Namespace::get_data_file_path(), File_Namespace::FileMgr::getMetadataForFile(), File_Namespace::open(), File_Namespace::FileMgr::renameAndSymlinkLegacyFiles(), and anonymous_namespace{TableArchiver.cpp}::update_or_drop_column_ids_in_page_headers().