<commit_before>#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "file.h"

static char *home;

void file_init()
{

    char command[128];

    home = getenv("HOME");

    snprintf(command, 128, "mkdir -p %s/.ztore", home);
    system(command);

}

void file_getdatabasepath(char *path, unsigned int count)
{

    snprintf(path, count, "%s/.ztore/data.db", home);

}

void file_getremotedatabasepath(char *path, unsigned int count, unsigned int id)
{

    snprintf(path, count, "%s/.ztore/remote_%u.db", home, id);

}

void file_getpackagepath(char *path, unsigned int count, char *name)
{

    snprintf(path, count, "/media/data/apps/%s", name);

}

unsigned int file_exist(char *path)
{

    return access(path, F_OK) != -1;

}

unsigned int file_copy(char *from, char *to)
{

    char command[128];

    snprintf(command, 128, "cp %s %s", from, to);

    return system(command) == 0;

}

unsigned int file_remove(char *name)
{

    char command[128];

    snprintf(command, 128, "rm %s", name);

    return system(command) == 0;

}

unsigned int file_removeremote(unsigned int id)
{

    char remotedatapath[64];

    file_getremotedatabasepath(remotedatapath, 64, id);
    file_remove(remotedatapath);

    return 1;

}

unsigned int file_download(char *url, char *to)
{

    char command[128];

    snprintf(command, 128, "wget %s -O %s", url, to);

    return system(command) == 0;

}

unsigned int file_downloadremote(char *url, unsigned int id)
{

    char downloadpath[256];
    char remotedatapath[64];

    snprintf(downloadpath, 256, url);
    file_getremotedatabasepath(remotedatapath, 64, id);

    return file_download(downloadpath, remotedatapath);

}
<commit_msg>more fixes<commit_after>#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "file.h"

static char *home;

void file_init()
{

    char command[128];

    home = getenv("HOME");

    snprintf(command, 128, "mkdir -p %s/.ztore", home);
    system(command);

}

void file_getdatabasepath(char *path, unsigned int count)
{

    snprintf(path, count, "%s/.ztore/data.db", home);

}

void file_getremotedatabasepath(char *path, unsigned int count, unsigned int id)
{

    snprintf(path, count, "%s/.ztore/remote_%u.db", home, id);

}

void file_getpackagepath(char *path, unsigned int count, char *name)
{

    snprintf(path, count, "/media/data/apps/%s", name);

}

unsigned int file_exist(char *path)
{

    return access(path, F_OK) != -1;

}

unsigned int file_copy(char *from, char *to)
{

    char command[128];

    snprintf(command, 128, "cp %s %s", from, to);

    return system(command) == 0;

}

unsigned int file_remove(char *name)
{

    char command[128];

    snprintf(command, 128, "rm %s", name);

    return system(command) == 0;

}

unsigned int file_removeremote(unsigned int id)
{

    char remotedatapath[64];

    file_getremotedatabasepath(remotedatapath, 64, id);

    return file_remove(remotedatapath);

}

unsigned int file_download(char *url, char *to)
{

    char command[128];

    snprintf(command, 128, "wget %s -O %s", url, to);

    return system(command) == 0;

}

unsigned int file_downloadremote(char *url, unsigned int id)
{

    char downloadpath[256];
    char remotedatapath[64];

    snprintf(downloadpath, 256, url);
    file_getremotedatabasepath(remotedatapath, 64, id);

    return file_download(downloadpath, remotedatapath);

}

{'fraction_non_alphanumeric': 0.14223130841121495, 'fraction_numerical': 0.024824766355140186, 'mean_word_length': 3.942279942279942, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6661541', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1225, 'n_words': 308}