libgpio
file.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2017 Animal Creek Technologies, Inc.
3  *
4  * Released under the MIT license.
5  * SPDX-License-Identifier: MIT
6  */
7 
8 #ifndef __LIBFILE_H
9 #define __LIBFILE_H
10 
17 #include <unistd.h>
18 #include <stdbool.h>
19 
20 int file_get_size(char *filename, off_t *size);
21 bool file_is_present(char *filename);
22 int file_read(int fd, void *buf, size_t len);
23 int file_write(int fd, void *buf, size_t len);
24 int file_owc(char *filename, void *buf, size_t len);
25 
26 #endif
int file_write(int fd, void *buf, size_t len)
Write specified number of bytes to file or socket.
Definition: file.c:106
int file_get_size(char *filename, off_t *size)
Get size of file in bytes.
Definition: file.c:29
int file_owc(char *filename, void *buf, size_t len)
Open, write to, and close a file.
Definition: file.c:134
int file_read(int fd, void *buf, size_t len)
Read specified number of bytes from file or socket.
Definition: file.c:73
bool file_is_present(char *filename)
Determine if file is present (i.e., exists)
Definition: file.c:50