1 | /*------------------------------------------------------------------------- |
2 | * |
3 | * file_ops.h |
4 | * Helper functions for operating on files |
5 | * |
6 | * Copyright (c) 2013-2019, 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 remove_target_file(const char *path, bool missing_ok); |
19 | extern void truncate_target_file(const char *path, off_t newsize); |
20 | extern void create_target(file_entry_t *t); |
21 | extern void remove_target(file_entry_t *t); |
22 | |
23 | extern char *slurpFile(const char *datadir, const char *path, size_t *filesize); |
24 | |
25 | #endif /* FILE_OPS_H */ |
26 | |