<commit_before>/*
 * This file is part of libnica.
 *
 * Copyright (C) 2016 Intel Corporation
 *
 * libnica is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1
 * of the License, or (at your option) any later version.
 */

#pragma once

#ifndef LIBNICA_INTERNAL
#error You should only include <nica.h>
#endif

#include <nica/macros.h>
#include <stdbool.h>
#include <stdint.h>

/**
 * Determine whether the given path exists in the filesystem
 *
 * @param path Path to the file we should check
 */
_nica_public_ bool nc_file_exists(const char *path);

/**
 * Return the parent path for a given file
 *
 * @note This is an allocated string, and must be freed by the caller
 * @param p Path to file
 * @return a newly allocated string
 */
_nica_public_ char *nc_get_file_parent(const char *path);

/**
 * Recursively make the directories for the given path
 *
 * @param path Path to directory to create
 * @param mode Mode to create new directories with
 *
 * @return A boolean value, indicating success or failure
 */
_nica_public_ bool nc_mkdir_p(const char *path, mode_t mode);

/**
 * Recursively remove the tree at @path<commit_msg>files: Add missing includes<commit_after>/*
 * This file is part of libnica.
 *
 * Copyright (C) 2016 Intel Corporation
 *
 * libnica is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1
 * of the License, or (at your option) any later version.
 */

#pragma once

#ifndef LIBNICA_INTERNAL
#error You should only include <nica.h>
#endif

#include <nica/macros.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
#include <stdarg.h>

/**
 * Determine whether the given path exists in the filesystem
 *
 * @param path Path to the file we should check
 */
_nica_public_ bool nc_file_exists(const char *path);

/**
 * Return the parent path for a given file
 *
 * @note This is an allocated string, and must be freed by the caller
 * @param p Path to file
 * @return a newly allocated string
 */
_nica_public_ char *nc_get_file_parent(const char *path);

/**
 * Recursively make the directories for the given path
 *
 * @param path Path to directory to create
 * @param mode Mode to create new directories with
 *
 * @return A boolean value, indicating success or failure
 */
_nica_public_ bool nc_mkdir_p(const char *path, mode_t mode);

/**
 * Recursively remove the tree at @path
{'fraction_non_alphanumeric': 0.08323699421965318, 'fraction_numerical': 0.004624277456647399, 'mean_word_length': 3.9827255278310942, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4520046', 'n_tokens_mistral': 782, 'n_tokens_neox': 771, 'n_words': 352}