<commit_before>#![crate_name = "benton"]

use std::os;

fn main() {
    let arguments = os::args();

    if arguments.len() != 2 {
        println!("Usage: benton <file>");
        return;
    }

    let ref filename = arguments[1];

    println!("Filename: {}", filename);
}<commit_msg>A little step forward in main.rs<commit_after>#![crate_name = "benton"]

use std::os;
use std::io::File;

fn main() {
    let arguments = os::args();

    if arguments.len() != 2 {
        println!("Usage: {} <file>", arguments[0]);
        return;
    }

    let filename: &str = arguments[1].as_slice();

    println!("Filename: {}", filename);

    let mut reader = match File::open(&Path::new(filename)) {
        Ok(file) => box file as Box<Reader>,
        Err(_) => {
            println!("Cannot open the file.");
            return;
        }
    };

    let mut buffer = [0, ..4];

    let tag = match reader.read(buffer) {
        Ok(n) => {
            match std::str::from_utf8(buffer.slice_to(n)) {
                Some(string) => string,
                None => {
                    println!("Cannot read the file.")
                    return;
                }
            }
        },
        Err(_) => {
            println!("Cannot read the file.");
            return;
        }
    };

    println!("Tag: {}", tag);
}
{'fraction_non_alphanumeric': 0.1733232856066315, 'fraction_numerical': 0.006028636021100226, 'mean_word_length': 1.8016877637130801, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 12, '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': '1814783', 'n_tokens_mistral': 414, 'n_tokens_neox': 398, 'n_words': 95}