From 5dd1a81f9c97d852faa54e0d96482b69739fe8dc Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Mon, 24 Feb 2020 21:01:25 +0000 Subject: utils/file: Add netsurf_recursive_rm This is to be used to remove the disc cache (and other things if useful in the future) Signed-off-by: Daniel Silverstone --- utils/file.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'utils/file.h') diff --git a/utils/file.h b/utils/file.h index 0282c350e..809ffe419 100644 --- a/utils/file.h +++ b/utils/file.h @@ -172,4 +172,15 @@ nserror netsurf_path_to_nsurl(const char *path, struct nsurl **url); */ nserror netsurf_mkdir_all(const char *fname); +/** + * Recursively remove a directory + * + * If this returns a failure code, there's an unpredictable amount left + * unremoved. + * + * @param path The path to recursively remove + * @return NSERROR_OK on success, or an error code on failure. + */ +nserror netsurf_recursive_rm(const char *path); + #endif -- cgit v1.2.3