<commit_before>#include <platform.h>
#include <pony.h>
#include "lang.h"

typedef struct pony_mode_t
{
  pony_type_t* desc;
  bool setuid;
  bool setgid;
  bool sticky;
  bool owner_read;
  bool owner_write;
  bool owner_exec;
  bool group_read;
  bool group_write;
  bool group_exec;
  bool any_read;
  bool any_write;
  bool any_exec;
} pony_mode_t;

typedef struct pony_stat_t
{
  pony_type_t* desc;

  void* path;
  pony_mode_t* mode;

  uint32_t hard_links;
  uint32_t uid;
  uint32_t gid;
  uint64_t size;
  int64_t access_time;
  int64_t access_time_nsec;
  int64_t modified_time;
  int64_t modified_time_nsec;
  int64_t change_time;
  int64_t change_time_nsec;

  bool file;
  bool directory;
  bool pipe;
  bool symlink;
  bool broken;
} pony_stat_t;

PONY_EXTERN_C_BEGIN

#ifdef PLATFORM_IS_WINDOWS
void filetime_to_ts(FILETIME* ft, int64_t* s, int64_t* ns)
{
  int64_t epoch = ((int64_t)ft->dwHighDateTime << 32) | ft->dwLowDateTime;
  epoch -= 116444736000000000;
  *s = epoch / 10000000;
  *ns = (epoch - (*s * 10000000)) * 100
}
#endif

bool os_stat(const char* path, pony_stat_t* p)
{<commit_msg>fixed windows build<commit_after>#include <platform.h>
#include <pony.h>
#include "lang.h"

typedef struct pony_mode_t
{
  pony_type_t* desc;
  bool setuid;
  bool setgid;
  bool sticky;
  bool owner_read;
  bool owner_write;
  bool owner_exec;
  bool group_read;
  bool group_write;
  bool group_exec;
  bool any_read;
  bool any_write;
  bool any_exec;
} pony_mode_t;

typedef struct pony_stat_t
{
  pony_type_t* desc;

  void* path;
  pony_mode_t* mode;

  uint32_t hard_links;
  uint32_t uid;
  uint32_t gid;
  uint64_t size;
  int64_t access_time;
  int64_t access_time_nsec;
  int64_t modified_time;
  int64_t modified_time_nsec;
  int64_t change_time;
  int64_t change_time_nsec;

  bool file;
  bool directory;
  bool pipe;
  bool symlink;
  bool broken;
} pony_stat_t;

PONY_EXTERN_C_BEGIN

#ifdef PLATFORM_IS_WINDOWS
void filetime_to_ts(FILETIME* ft, int64_t* s, int64_t* ns)
{
  int64_t epoch = ((int64_t)ft->dwHighDateTime << 32) | ft->dwLowDateTime;
  epoch -= 116444736000000000;
  *s = epoch / 10000000;
  *ns = (epoch - (*s * 10000000)) * 100;
}
#endif

bool os_stat(const char* path, pony_stat_t* p)
{
{'fraction_non_alphanumeric': 0.09286675639300135, 'fraction_numerical': 0.060116644235083, 'mean_word_length': 4.2718676122931445, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, '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': '4594088', 'n_tokens_mistral': 1058, 'n_tokens_neox': 941, 'n_words': 218}