OmniSciDB  8a228a1076
File_Namespace Namespace Reference

Classes

class  FileBuffer
 Represents/provides access to contiguous data stored in the file system. More...
 
struct  FileInfo
 
class  FileMgr
 
class  GlobalFileMgr
 
struct  HeaderInfo
 Stores Pair of ChunkKey and Page id and version, in a pair with a Page struct itself (File id and Page num) More...
 
struct  MultiPage
 The MultiPage stores versions of the same logical page in a deque. More...
 
struct  Page
 A logical page (Page) belongs to a file on disk. More...
 
struct  readThreadDS
 

Typedefs

using PageSizeFileMMap = std::multimap< size_t, int >
 Maps logical page sizes to files. More...
 
using Chunk = FileBuffer
 A Chunk is the fundamental unit of execution in Map-D. More...
 
using ChunkKeyToChunkMap = std::map< ChunkKey, FileBuffer * >
 Maps ChunkKeys (unique ids for Chunks) to Chunk objects. More...
 

Functions

static size_t readForThread (FileBuffer *fileBuffer, const readThreadDS threadDS)
 
bool headerCompare (const HeaderInfo &firstElem, const HeaderInfo &secondElem)
 
FILE * create (const std::string &basePath, const int fileId, const size_t pageSize, const size_t numPages)
 
FILE * create (const std::string &fullPath, const size_t requestedFileSize)
 
FILE * open (int fileId)
 Opens/creates the file with the given id; returns NULL on error. More...
 
FILE * open (const std::string &path)
 
void close (FILE *f)
 Closes the file pointed to by the FILE pointer. More...
 
bool removeFile (const std::string basePath, const std::string filename)
 Deletes the file pointed to by the FILE pointer. More...
 
size_t read (FILE *f, const size_t offset, const size_t size, int8_t *buf)
 Reads the specified number of bytes from the offset position in file f into buf. More...
 
size_t write (FILE *f, const size_t offset, const size_t size, int8_t *buf)
 Writes the specified number of bytes to the offset position in file f from buf. More...
 
size_t append (FILE *f, const size_t size, int8_t *buf)
 Appends the specified number of bytes to the end of the file f from buf. More...
 
size_t readPage (FILE *f, const size_t pageSize, const size_t pageNum, int8_t *buf)
 Reads the specified page from the file f into buf. More...
 
size_t readPartialPage (FILE *f, const size_t pageSize, const size_t offset, const size_t readSize, const size_t pageNum, int8_t *buf)
 
size_t 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 writePartialPage (FILE *f, const size_t pageSize, const size_t offset, const size_t writeSize, const size_t pageNum, int8_t *buf)
 
size_t appendPage (FILE *f, const size_t pageSize, int8_t *buf)
 Appends a page from buf to the file. More...
 
size_t fileSize (FILE *f)
 Returns the size of the specified file. More...
 
void renameForDelete (const std::string directoryName)
 Renames a directory to DELETE_ME_<EPOCH>_<oldname>. More...
 

Typedef Documentation

◆ Chunk

A Chunk is the fundamental unit of execution in Map-D.

Chunk A chunk is composed of logical pages. These pages can exist across multiple files managed by the file manager.

The collection of pages is implemented as a FileBuffer object, which is composed of a vector of MultiPage objects, one for each logical page of the file buffer.

Definition at line 67 of file FileMgr.h.

◆ ChunkKeyToChunkMap

Maps ChunkKeys (unique ids for Chunks) to Chunk objects.

ChunkKeyToChunkMap The file system can store multiple chunks across multiple files. With that in mind, the challenge is to be able to reconstruct the pages that compose a chunk upon request. A chunk key (ChunkKey) uniquely identifies a chunk, and so ChunkKeyToChunkMap maps chunk keys to Chunk types, which are vectors of MultiPage* pointers (logical pages).

Definition at line 79 of file FileMgr.h.

◆ PageSizeFileMMap

using File_Namespace::PageSizeFileMMap = typedef std::multimap<size_t, int>

Maps logical page sizes to files.

PageSizeFileMMap The file manager uses this type in order to quickly find files of a certain page size. A multimap is used to associate the key (page size) with values (file identifiers of files having the matching page size).

Definition at line 55 of file FileMgr.h.

Function Documentation

◆ append()

size_t File_Namespace::append ( FILE *  f,
const size_t  size,
int8_t *  buf 
)

Appends the specified number of bytes to the end of the file f from buf.

Parameters
fPointer to the FILE.
nThe number of bytes to append to the file.
bufThe source buffer containing the data to be appended.
errIf not NULL, will hold an error code should an error occur.
Returns
size_t The number of bytes written.

Definition at line 140 of file File.cpp.

References fileSize(), and write().

Referenced by ArrowCsvForeignStorage::ArrowCsvForeignStorage(), analyze_benchmark.BenchAnalyzer::collectMissingQueries(), analyze_benchmark.PrettyPrint::collectMissingQueries(), concat(), concat_with(), com.mapd.utility.SQLImporter::createMapDTable(), ArrowResultSetConverter::getArrowBatch(), run_benchmark::read_query_files(), run_benchmark_arrow::run_query(), run_benchmark::run_query(), com.omnisci.jdbc.OmniSciArray::toString(), ResultSet::updateStorageEntryCount(), and PersistentForeignStorageInterface::~PersistentForeignStorageInterface().

140  {
141  return write(f, fileSize(f), size, buf);
142 }
size_t fileSize(FILE *f)
Returns the size of the specified file.
Definition: File.cpp:175
size_t write(FILE *f, const size_t offset, const size_t size, int8_t *buf)
Writes the specified number of bytes to the offset position in file f from buf.
Definition: File.cpp:125
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appendPage()

size_t File_Namespace::appendPage ( FILE *  f,
const size_t  pageSize,
int8_t *  buf 
)

Appends a page from buf to the file.

Parameters
fPointer to the FILE.
pageSizeThe logical page size of the file.
bufThe source buffer from where data is being read.
errIf not NULL, will hold an error code should an error occur.
Returns
size_t The number of bytes appended (should be equal to pageSize).

Definition at line 170 of file File.cpp.

References fileSize(), and write().

170  {
171  return write(f, fileSize(f), pageSize, buf);
172 }
size_t fileSize(FILE *f)
Returns the size of the specified file.
Definition: File.cpp:175
size_t write(FILE *f, const size_t offset, const size_t size, int8_t *buf)
Writes the specified number of bytes to the offset position in file f from buf.
Definition: File.cpp:125
+ Here is the call graph for this function:

◆ close()

void File_Namespace::close ( FILE *  f)

Closes the file pointed to by the FILE pointer.

Parameters
fPointer to the FILE.

Definition at line 106 of file File.cpp.

References CHECK, and CHECK_EQ.

Referenced by File_Namespace::FileMgr::closeRemovePhysical(), import_export::DataStreamSink::import_compressed(), CommandLineOptions::validate(), File_Namespace::FileInfo::~FileInfo(), File_Namespace::FileMgr::~FileMgr(), and StringDictionary::~StringDictionary().

106  {
107  CHECK(f);
108  CHECK_EQ(fflush(f), 0);
109  CHECK_EQ(fclose(f), 0);
110 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
#define CHECK(condition)
Definition: Logger.h:197
+ Here is the caller graph for this function:

◆ create() [1/2]

FILE * File_Namespace::create ( const std::string &  basePath,
const int  fileId,
const size_t  pageSize,
const size_t  numPages 
)

Definition at line 39 of file File.cpp.

References logger::FATAL, fileSize(), LOG, MAPD_FILE_EXT, and to_string().

Referenced by File_Namespace::FileMgr::createDBMetaFile(), File_Namespace::FileMgr::createEpochFile(), and File_Namespace::FileMgr::createFile().

42  {
43  std::string path(basePath + "/" + std::to_string(fileId) + "." +
44  std::to_string(pageSize) +
45  std::string(MAPD_FILE_EXT)); // MAPD_FILE_EXT has preceding "."
46  if (numPages < 1 || pageSize < 1) {
47  LOG(FATAL) << "Error trying to create file '" << path
48  << "', Number of pages and page size must be positive integers. numPages "
49  << numPages << " pageSize " << pageSize;
50  }
51  FILE* f = fopen(path.c_str(), "w+b");
52  if (f == nullptr) {
53  LOG(FATAL) << "Error trying to create file '" << path
54  << "', the error was: " << std::strerror(errno);
55  ;
56  }
57  fseek(f, static_cast<long>((pageSize * numPages) - 1), SEEK_SET);
58  fputc(EOF, f);
59  fseek(f, 0, SEEK_SET); // rewind
60  if (fileSize(f) != pageSize * numPages) {
61  LOG(FATAL) << "Error trying to create file '" << path << "', file size "
62  << fileSize(f) << " does not equal pageSize * numPages "
63  << pageSize * numPages;
64  }
65 
66  return f;
67 }
#define LOG(tag)
Definition: Logger.h:188
#define MAPD_FILE_EXT
Definition: File.h:25
std::string to_string(char const *&&v)
size_t fileSize(FILE *f)
Returns the size of the specified file.
Definition: File.cpp:175
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create() [2/2]

FILE * File_Namespace::create ( const std::string &  fullPath,
const size_t  requestedFileSize 
)

Definition at line 69 of file File.cpp.

References logger::FATAL, fileSize(), and LOG.

69  {
70  FILE* f = fopen(fullPath.c_str(), "w+b");
71  if (f == nullptr) {
72  LOG(FATAL) << "Error trying to create file '" << fullPath
73  << "', the error was: " << std::strerror(errno);
74  ;
75  }
76  fseek(f, static_cast<long>(requestedFileSize - 1), SEEK_SET);
77  fputc(EOF, f);
78  fseek(f, 0, SEEK_SET); // rewind
79  if (fileSize(f) != requestedFileSize) {
80  LOG(FATAL) << "Error trying to create file '" << fullPath << "', file size "
81  << fileSize(f) << " does not equal requestedFileSize "
82  << requestedFileSize;
83  }
84  return f;
85 }
#define LOG(tag)
Definition: Logger.h:188
size_t fileSize(FILE *f)
Returns the size of the specified file.
Definition: File.cpp:175
+ Here is the call graph for this function:

◆ fileSize()

size_t File_Namespace::fileSize ( FILE *  f)

Returns the size of the specified file.

Todo:
There may be an issue casting to size_t from long.
Parameters
fA pointer to the file.
Returns
size_t The number of bytes of the file.

Definition at line 175 of file File.cpp.

Referenced by append(), appendPage(), create(), and File_Namespace::FileMgr::init().

175  {
176  fseek(f, 0, SEEK_END);
177  size_t size = (size_t)ftell(f);
178  fseek(f, 0, SEEK_SET);
179  return size;
180 }
+ Here is the caller graph for this function:

◆ headerCompare()

bool File_Namespace::headerCompare ( const HeaderInfo firstElem,
const HeaderInfo secondElem 
)

Definition at line 50 of file FileMgr.cpp.

References File_Namespace::HeaderInfo::chunkKey, File_Namespace::HeaderInfo::pageId, and File_Namespace::HeaderInfo::versionEpoch.

Referenced by File_Namespace::FileMgr::init().

50  {
51  // HeaderInfo.first is a pair of Chunk key with a vector containing
52  // pageId and version
53  if (firstElem.chunkKey != secondElem.chunkKey) {
54  return firstElem.chunkKey < secondElem.chunkKey;
55  }
56  if (firstElem.pageId != secondElem.pageId) {
57  return firstElem.pageId < secondElem.pageId;
58  }
59  return firstElem.versionEpoch < secondElem.versionEpoch;
60 
61  /*
62  if (firstElem.first.first != secondElem.first.first)
63  return firstElem.first.first < secondElem.first.first;
64  return firstElem.first.second < secondElem.first.second;
65  */
66 }
+ Here is the caller graph for this function:

◆ open() [1/2]

FILE * File_Namespace::open ( int  fileId)

Opens/creates the file with the given id; returns NULL on error.

Parameters
fileIdThe id of the file to open.
Returns
FILE* A pointer to a FILE pointer, or NULL on error.

Definition at line 87 of file File.cpp.

References logger::FATAL, LOG, MAPD_FILE_EXT, and to_string().

Referenced by anonymous_namespace{StringDictionary.cpp}::checked_open(), create_table.SyntheticTable::generateData(), analyze_benchmark.BenchmarkLoader::load(), File_Namespace::FileMgr::openDBMetaFile(), File_Namespace::FileMgr::openEpochFile(), File_Namespace::FileMgr::openExistingFile(), run_benchmark::read_query_files(), run_benchmark::send_results_db(), run_benchmark::send_results_file_json(), run_benchmark::send_results_jenkins_bench(), and CommandLineOptions::validate().

87  {
88  std::string s(std::to_string(fileId) + std::string(MAPD_FILE_EXT));
89  FILE* f = fopen(s.c_str(), "r+b"); // opens existing file for updates
90  if (f == nullptr) {
91  LOG(FATAL) << "Error trying to open file '" << s
92  << "', the error was: " << std::strerror(errno);
93  }
94  return f;
95 }
#define LOG(tag)
Definition: Logger.h:188
#define MAPD_FILE_EXT
Definition: File.h:25
std::string to_string(char const *&&v)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ open() [2/2]

FILE * File_Namespace::open ( const std::string &  path)

Definition at line 97 of file File.cpp.

References logger::FATAL, and LOG.

97  {
98  FILE* f = fopen(path.c_str(), "r+b"); // opens existing file for updates
99  if (f == nullptr) {
100  LOG(FATAL) << "Error trying to open file '" << path
101  << "', the errno was: " << std::strerror(errno);
102  }
103  return f;
104 }
#define LOG(tag)
Definition: Logger.h:188

◆ read()

size_t File_Namespace::read ( FILE *  f,
const size_t  offset,
const size_t  size,
int8_t *  buf 
)

Reads the specified number of bytes from the offset position in file f into buf.

Parameters
fPointer to the FILE.
offsetThe location within the file from which to read.
nThe number of bytes to be read.
bufThe destination buffer to where data is being read from the file.
errIf not NULL, will hold an error code should an error occur.
Returns
size_t The number of bytes read.

Definition at line 117 of file File.cpp.

References CHECK_EQ.

Referenced by ArrowCsvForeignStorage::ArrowCsvForeignStorage(), File_Namespace::FileMgr::openDBMetaFile(), File_Namespace::FileMgr::openEpochFile(), File_Namespace::FileInfo::read(), readPage(), readPartialPage(), and PersistentForeignStorageInterface::~PersistentForeignStorageInterface().

117  {
118  // read "size" bytes from the offset location in the file into the buffer
119  CHECK_EQ(fseek(f, static_cast<long>(offset), SEEK_SET), 0);
120  size_t bytesRead = fread(buf, sizeof(int8_t), size, f);
121  CHECK_EQ(bytesRead, sizeof(int8_t) * size);
122  return bytesRead;
123 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
+ Here is the caller graph for this function:

◆ readForThread()

static size_t File_Namespace::readForThread ( FileBuffer fileBuffer,
const readThreadDS  threadDS 
)
static

Definition at line 201 of file FileBuffer.cpp.

References CHECK, File_Namespace::FileMgr::getFileInfoForFileId(), File_Namespace::readThreadDS::multiPages, File_Namespace::FileBuffer::pageDataSize(), File_Namespace::FileBuffer::pageSize(), File_Namespace::FileInfo::read(), File_Namespace::FileBuffer::reservedHeaderSize(), File_Namespace::readThreadDS::t_bytesLeft, File_Namespace::readThreadDS::t_curPtr, File_Namespace::readThreadDS::t_endPage, File_Namespace::readThreadDS::t_fm, File_Namespace::readThreadDS::t_isFirstPage, File_Namespace::readThreadDS::t_startPage, and File_Namespace::readThreadDS::t_startPageOffset.

Referenced by File_Namespace::FileBuffer::read().

201  {
202  size_t startPage = threadDS.t_startPage; // start reading at startPage, including it
203  size_t endPage = threadDS.t_endPage; // stop reading at endPage, not including it
204  int8_t* curPtr = threadDS.t_curPtr;
205  size_t bytesLeft = threadDS.t_bytesLeft;
206  size_t totalBytesRead = 0;
207  bool isFirstPage = threadDS.t_isFirstPage;
208 
209  // Traverse the logical pages
210  for (size_t pageNum = startPage; pageNum < endPage; ++pageNum) {
211  CHECK(threadDS.multiPages[pageNum].pageSize == fileBuffer->pageSize());
212  Page page = threadDS.multiPages[pageNum].current();
213 
214  FileInfo* fileInfo = threadDS.t_fm->getFileInfoForFileId(page.fileId);
215  CHECK(fileInfo);
216 
217  // Read the page into the destination (dst) buffer at its
218  // current (cur) location
219  size_t bytesRead = 0;
220  if (isFirstPage) {
221  bytesRead = fileInfo->read(
222  page.pageNum * fileBuffer->pageSize() + threadDS.t_startPageOffset +
223  fileBuffer->reservedHeaderSize(),
224  min(fileBuffer->pageDataSize() - threadDS.t_startPageOffset, bytesLeft),
225  curPtr);
226  isFirstPage = false;
227  } else {
228  bytesRead = fileInfo->read(
229  page.pageNum * fileBuffer->pageSize() + fileBuffer->reservedHeaderSize(),
230  min(fileBuffer->pageDataSize(), bytesLeft),
231  curPtr);
232  }
233  curPtr += bytesRead;
234  bytesLeft -= bytesRead;
235  totalBytesRead += bytesRead;
236  }
237  CHECK(bytesLeft == 0);
238 
239  return (totalBytesRead);
240 }
#define CHECK(condition)
Definition: Logger.h:197
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readPage()

size_t File_Namespace::readPage ( FILE *  f,
const size_t  pageSize,
const size_t  pageNum,
int8_t *  buf 
)

Reads the specified page from the file f into buf.

Parameters
fPointer to the FILE.
pageSizeThe logical page size of the file.
pageNumThe page number from where data is being read.
bufThe destination buffer to where data is being written.
errIf not NULL, will hold an error code should an error occur.
Returns
size_t The number of bytes read (should be equal to pageSize).

Definition at line 144 of file File.cpp.

References read().

144  {
145  return read(f, pageNum * pageSize, pageSize, buf);
146 }
size_t read(FILE *f, const size_t offset, const size_t size, int8_t *buf)
Reads the specified number of bytes from the offset position in file f into buf.
Definition: File.cpp:117
+ Here is the call graph for this function:

◆ readPartialPage()

size_t File_Namespace::readPartialPage ( FILE *  f,
const size_t  pageSize,
const size_t  offset,
const size_t  readSize,
const size_t  pageNum,
int8_t *  buf 
)

Definition at line 148 of file File.cpp.

References read().

153  {
154  return read(f, pageNum * pageSize + offset, readSize, buf);
155 }
size_t read(FILE *f, const size_t offset, const size_t size, int8_t *buf)
Reads the specified number of bytes from the offset position in file f into buf.
Definition: File.cpp:117
+ Here is the call graph for this function:

◆ removeFile()

bool File_Namespace::removeFile ( const std::string  basePath,
const std::string  filename 
)

Deletes the file pointed to by the FILE pointer.

Parameters
basePathThe base path (directory) of the file.
fPointer to the FILE.
Returns
mapd_err_t Returns an error code when unable to close the file properly.

Definition at line 112 of file File.cpp.

References logger::filename().

112  {
113  const std::string filePath = basePath + filename;
114  return remove(filePath.c_str()) == 0;
115 }
std::string filename(char const *path)
Definition: Logger.cpp:62
+ Here is the call graph for this function:

◆ renameForDelete()

void File_Namespace::renameForDelete ( const std::string  directoryName)

Renames a directory to DELETE_ME_<EPOCH>_<oldname>.

Parameters
directoryNamename of directory

Definition at line 187 of file File.cpp.

References logger::ERROR, error_code, logger::FATAL, LOG, and to_string().

Referenced by File_Namespace::FileMgr::closeRemovePhysical(), Catalog_Namespace::Catalog::delDictionary(), Catalog_Namespace::Catalog::doTruncateTable(), and Catalog_Namespace::Catalog::removeTableFromMap().

187  {
189  boost::filesystem::path directoryPath(directoryName);
190  using namespace std::chrono;
191  milliseconds ms = duration_cast<milliseconds>(system_clock::now().time_since_epoch());
192 
193  if (boost::filesystem::exists(directoryPath) &&
194  boost::filesystem::is_directory(directoryPath)) {
195  boost::filesystem::path newDirectoryPath(directoryName + "_" +
196  std::to_string(ms.count()) + "_DELETE_ME");
197  boost::filesystem::rename(directoryPath, newDirectoryPath, ec);
198 
199  if (ec.value() == boost::system::errc::success) {
200  std::thread th([newDirectoryPath]() {
202  boost::filesystem::remove_all(newDirectoryPath, ec);
203  if (ec.value() != boost::system::errc::success) {
204  LOG(ERROR) << "Failed to remove directory " << newDirectoryPath << " error was "
205  << ec;
206  }
207  });
208  // let it run free so we can return
209  // if it fails the file_delete_thread in DBHandler will clean up
210  th.detach();
211 
212  return;
213  }
214 
215  LOG(FATAL) << "Failed to rename file " << directoryName << " to "
216  << directoryName + "_" + std::to_string(ms.count()) + "_DELETE_ME Error: "
217  << ec;
218  }
219 }
#define LOG(tag)
Definition: Logger.h:188
std::string to_string(char const *&&v)
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t * error_code
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write()

size_t File_Namespace::write ( FILE *  f,
const size_t  offset,
const size_t  size,
int8_t *  buf 
)

Writes the specified number of bytes to the offset position in file f from buf.

Parameters
fPointer to the FILE.
offsetThe location within the file where data is being written.
sizeThe number of bytes to write to the file.
bufThe source buffer containing the data to be written.
errIf not NULL, will hold an error code should an error occur.
Returns
size_t The number of bytes written.

Definition at line 125 of file File.cpp.

References logger::FATAL, and LOG.

Referenced by StringDictionary::addStorageCapacity(), append(), appendPage(), File_Namespace::FileMgr::createDBMetaFile(), File_Namespace::FileMgr::createEpochFile(), File_Namespace::FileInfo::freePage(), import_export::DataStreamSink::import_compressed(), File_Namespace::FileInfo::initNewFile(), File_Namespace::FileInfo::openExistingFile(), CommandLineOptions::validate(), File_Namespace::FileInfo::write(), File_Namespace::FileMgr::writeAndSyncDBMetaToDisk(), File_Namespace::FileMgr::writeAndSyncEpochToDisk(), writePage(), and writePartialPage().

125  {
126  // write size bytes from the buffer to the offset location in the file
127  if (fseek(f, static_cast<long>(offset), SEEK_SET) != 0) {
128  LOG(FATAL)
129  << "Error trying to write to file (during positioning seek) the error was: "
130  << std::strerror(errno);
131  }
132  size_t bytesWritten = fwrite(buf, sizeof(int8_t), size, f);
133  if (bytesWritten != sizeof(int8_t) * size) {
134  LOG(FATAL) << "Error trying to write to file (during fwrite) the error was: "
135  << std::strerror(errno);
136  }
137  return bytesWritten;
138 }
#define LOG(tag)
Definition: Logger.h:188
+ Here is the caller graph for this function:

◆ writePage()

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.

Parameters
fPointer to the FILE.
pageSizeThe logical page size of the file.
pageNumThe page number to where data is being written.
bufThe source buffer from where data is being read.
errIf not NULL, will hold an error code should an error occur.
Returns
size_t The number of bytes written (should be equal to pageSize).

Definition at line 157 of file File.cpp.

References write().

157  {
158  return write(f, pageNum * pageSize, pageSize, buf);
159 }
size_t write(FILE *f, const size_t offset, const size_t size, int8_t *buf)
Writes the specified number of bytes to the offset position in file f from buf.
Definition: File.cpp:125
+ Here is the call graph for this function:

◆ writePartialPage()

size_t File_Namespace::writePartialPage ( FILE *  f,
const size_t  pageSize,
const size_t  offset,
const size_t  writeSize,
const size_t  pageNum,
int8_t *  buf 
)

Definition at line 161 of file File.cpp.

References write().

166  {
167  return write(f, pageNum * pageSize + offset, writeSize, buf);
168 }
size_t write(FILE *f, const size_t offset, const size_t size, int8_t *buf)
Writes the specified number of bytes to the offset position in file f from buf.
Definition: File.cpp:125
+ Here is the call graph for this function: