PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
file_ops.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * file_ops.h
4  * Helper functions for operating on files
5  *
6  * Copyright (c) 2013-2017, PostgreSQL Global Development Group
7  *
8  *-------------------------------------------------------------------------
9  */
10 #ifndef FILE_OPS_H
11 #define FILE_OPS_H
12 
13 #include "filemap.h"
14 
15 extern void open_target_file(const char *path, bool trunc);
16 extern void write_target_range(char *buf, off_t begin, size_t size);
17 extern void close_target_file(void);
18 extern void truncate_target_file(const char *path, off_t newsize);
19 extern void create_target(file_entry_t *t);
20 extern void remove_target(file_entry_t *t);
21 
22 extern char *slurpFile(const char *datadir, const char *path, size_t *filesize);
23 
24 #endif /* FILE_OPS_H */
char * slurpFile(const char *datadir, const char *path, size_t *filesize)
Definition: file_ops.c:276
void close_target_file(void)
Definition: file_ops.c:71
static char * buf
Definition: pg_test_fsync.c:66
char * datadir
void open_target_file(const char *path, bool trunc)
Definition: file_ops.c:43
Definition: filemap.h:42
void remove_target(file_entry_t *t)
Definition: file_ops.c:126
void truncate_target_file(const char *path, off_t newsize)
Definition: file_ops.c:183
void write_target_range(char *buf, off_t begin, size_t size)
Definition: file_ops.c:84
void create_target(file_entry_t *t)
Definition: file_ops.c:147