<commit_before>---
layout: post
title:  "Get owner for a file"
date:   2016-03-18
categories: Linux, C
---

{% highlight python %}
#include <stdio.h>
#include <pwd.h>
#include <sys/stat.h>

int main(int argc, char *argv[])
{
    char *fname = argv[1];
    printf("file:%s\n", fname);
    
    struct stat info;
    stat(fname, &info);
    
    struct passwd *pw = getpwuid(info.st_uid);
    printf("user:%s\n", pw->pw_name);
    
    return 0;
}
{% endhighlight %}

        

<commit_msg>modified the  coding format<commit_after>---
layout: post
title:  "Get owner for a file"
date:   2016-03-18
categories: Linux, C
---

{% highlight C %}
#include <stdio.h>
#include <pwd.h>
#include <sys/stat.h>

int main(int argc, char *argv[])
{
    char *fname = argv[1];
    printf("file:%s\n", fname);
    
    struct stat info;
    stat(fname, &info);
    
    struct passwd *pw = getpwuid(info.st_uid);
    printf("user:%s\n", pw->pw_name);
    
    return 0;
}
{% endhighlight %}

        


{'fraction_non_alphanumeric': 0.17258883248730963, 'fraction_numerical': 0.02030456852791878, 'mean_word_length': 2.720754716981132, 'pattern_counts': {'":': 0, '<': 9, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5885967', 'n_tokens_mistral': 401, 'n_tokens_neox': 373, 'n_words': 95}