From e660e511ae29b914cfc47413f5ac1107c2da0693 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 22 Jan 2018 11:13:27 +0100 Subject: libfile: implement a function to cache a file Due to the nature of TFTP which can't lseek and due to the silliness of our filesystem implementation which can't cache accesses we have to manually cache files on TFTP filesystems sometimes. Make it easier for them by providing a cache_file() function which copies the file from TFTP to RAM. Signed-off-by: Sascha Hauer --- include/libfile.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/libfile.h b/include/libfile.h index 6dbb81a241..beec7cff79 100644 --- a/include/libfile.h +++ b/include/libfile.h @@ -28,4 +28,6 @@ int unlink_recursive(const char *path, char **failedpath); char *make_temp(const char *template); +int cache_file(const char *path, char **newpath); + #endif /* __LIBFILE_H */ -- cgit v1.2.3