<commit_before>#include "GarageDoor/Filesystem.h"

std::vector<std::string> GarageDoor::Filesystem::ListDirectory(tstring path)
{
    std::vector<std::string> dirlist;

    DIR * dir = opendir(path.c_str());
    struct dirent * entry = readdir(dir);

    while (entry != NULL)
    {
        std::stringstream ss;
        ss << entry->d_name;
        std::string name = ss.str();

        if ( name != "." && name != ".." )
        {
            dirlist.push_back(name);
        }

        entry = readdir(dir);
    }

    closedir(dir);
    return dirlist;
}

tstring GarageDoor::Filesystem::ReadFile(tstring path)
{
    std::ifstream file(path);
    std::stringstream buffer;
    buffer << file.rdbuf();

    return buffer.str();
}

void GarageDoor::Filesystem::WriteFile(tstring path, tstring contents)
{
    std::ofstream file(path);
    if (!file)
    {
        std::cerr << "Cannot open the output file." << std::endl;
        return;
    }

    file << contents;
    file.close();
}<commit_msg>Test again<commit_after>#include "GarageDoor/Filesystem.h"

std::vector<std::string> GarageDoor::Filesystem::ListDirectory(tstring path)
{
    std::vector<std::string> dirlist;

    DIR * dir = opendir(path.c_str());
    struct dirent * entry = readdir(dir);

    while (entry != NULL)
    {
        std::stringstream ss;
        ss << entry->d_name;
        std::string name = ss.str();

        if ( name != "." && name != ".." )
        {
            dirlist.push_back(name);
        }

        entry = readdir(dir);
    }

    closedir(dir);
    return dirlist;
}

tstring GarageDoor::Filesystem::ReadFile(tstring path)
{
    std::ifstream file(path);
    if (!file.good())
    {
        std::cerr << "Cannot open the output file at: " << path << std::endl;
        return nullptr;
    }
    std::stringstream buffer;
    buffer << file.rdbuf();

    return buffer.str();
}

void GarageDoor::Filesystem::WriteFile(tstring path, tstring contents)
{
    std::ofstream file(path);
    if (!file)
    {
        std::cerr << "Cannot open the output file." << std::endl;
        return;
    }

    file << contents;
    file.close();
}
{'fraction_non_alphanumeric': 0.15799343647444913, 'fraction_numerical': 0.0, 'mean_word_length': 2.5805369127516777, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 9, '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': '3687036', 'n_tokens_mistral': 724, 'n_tokens_neox': 704, 'n_words': 145}