summaryrefslogtreecommitdiffstats
path: root/include/libfile.h
blob: 3f81718bbdb9350ac039e8b25132133eedf1eb6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef __LIBFILE_H
#define __LIBFILE_H

int write_full(int fd, void *buf, size_t size);
int read_full(int fd, void *buf, size_t size);

char *read_file_line(const char *fmt, ...);

void *read_file(const char *filename, size_t *size);

int read_file_2(const char *filename, size_t *size, void **outbuf,
		loff_t max_size);

int write_file(const char *filename, void *buf, size_t size);

int copy_file(const char *src, const char *dst, int verbose);

int copy_recursive(const char *src, const char *dst);

int compare_file(const char *f1, const char *f2);

int open_and_lseek(const char *filename, int mode, loff_t pos);

/* Create a directory and its parents */
int make_directory(const char *pathname);

#endif /* __LIBFILE_H */