<commit_before>#ifdef PIXELBOOST_PLATFORM_OSX

#include <Foundation/Foundation.h>

#include "pixelboost/file/fileHelpers.h"

namespace pb
{
    
namespace FileHelpers
{
        
std::string GetRootPath()
{
    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
    std::string rootPath = [[[NSBundle mainBundle] resourcePath] UTF8String];
    [pool release];
    return rootPath;
}
    
std::string GetUserPath()
{
    return "";
}
    
bool pb::FileHelpers::CreateDirectory(const std::string& directory)
{
    NSString* dirToCreate = [NSString stringWithUTF8String:directory.c_str()];
    NSError* error = nil;
    BOOL isDir=YES;
    
    if([[NSFileManager defaultManager] fileExistsAtPath:dirToCreate isDirectory:&isDir] || !isDir)
        return false;
    
    if(![[NSFileManager defaultManager] createDirectoryAtPath:dirToCreate withIntermediateDirectories:YES attributes:nil error:&error])
    {
        return false;
    }
    
    return true;
}

int pb::FileHelpers::GetTimestamp(const std::string& filename)
{
    NSDictionary* attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:[NSString stringWithUTF8String:filename.c_str()] error:nil];
    
    if (attrs != nil)
    {
        NSDate *date = (NSDate*)[attrs objectForKey: NSFileModificationDate];
        return (int)[date timeIntervalSince1970];
    } 
    else {
        return 0;
    }
}
        
}
    <commit_msg>Fix compilation in XCode 4.6<commit_after>#ifdef PIXELBOOST_PLATFORM_OSX

#include <Foundation/Foundation.h>

#include "pixelboost/file/fileHelpers.h"

namespace pb
{
    
namespace FileHelpers
{
        
std::string GetRootPath()
{
    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
    std::string rootPath = [[[NSBundle mainBundle] resourcePath] UTF8String];
    [pool release];
    return rootPath;
}
    
std::string GetUserPath()
{
    return "";
}
    
bool CreateDirectory(const std::string& directory)
{
    NSString* dirToCreate = [NSString stringWithUTF8String:directory.c_str()];
    NSError* error = nil;
    BOOL isDir=YES;
    
    if([[NSFileManager defaultManager] fileExistsAtPath:dirToCreate isDirectory:&isDir] || !isDir)
        return false;
    
    if(![[NSFileManager defaultManager] createDirectoryAtPath:dirToCreate withIntermediateDirectories:YES attributes:nil error:&error])
    {
        return false;
    }
    
    return true;
}

int GetTimestamp(const std::string& filename)
{
    NSDictionary* attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:[NSString stringWithUTF8String:filename.c_str()] error:nil];
    
    if (attrs != nil)
    {
        NSDate *date = (NSDate*)[attrs objectForKey: NSFileModificationDate];
        return (int)[date timeIntervalSince1970];
    } 
    else {
        return 0;
    }
}
        
}
    
{'fraction_non_alphanumeric': 0.10991765127103473, 'fraction_numerical': 0.00644468313641246, 'mean_word_length': 3.6722408026755855, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2643670', 'n_tokens_mistral': 893, 'n_tokens_neox': 881, 'n_words': 174}