<commit_before><?php

namespace React\Filesystem;

use React\Filesystem\Eio\BufferedSink;
use React\Filesystem\Node;

class Filesystem
{

    public static function create($loop)
    {
        return new static($loop);
    }

    public function __construct($loop)
    {
        $this->loop = $loop;
        $this->filesystem = new EioFilesystem($loop);
    }

    public function file($filename)
    {
        return new Node\File($filename, $this->filesystem);
    }

    public function dir($path)
    {
        return new Node\Directory($path, $this->filesystem);
    }

    public function getContents($filename)
    {
        $this->open($filename)->then(function($stream) {
            return BufferedSink::createPromise($stream);
        });
    }
}<commit_msg>Used the proper way of opening a file and forcing it into read only mode<commit_after><?php

namespace React\Filesystem;

use React\Filesystem\Eio\BufferedSink;
use React\Filesystem\Node;

class Filesystem
{

    public static function create($loop)
    {
        return new static($loop);
    }

    public function __construct($loop)
    {
        $this->loop = $loop;
        $this->filesystem = new EioFilesystem($loop);
    }

    public function file($filename)
    {
        return new Node\File($filename, $this->filesystem);
    }

    public function dir($path)
    {
        return new Node\Directory($path, $this->filesystem);
    }

    public function getContents($filename)
    {
        return $this->file($filename)->open(EIO_O_RDONLY)->then(function($stream) {
            return BufferedSink::createPromise($stream);
        });
    }
}
{'fraction_non_alphanumeric': 0.12438423645320197, 'fraction_numerical': 0.0, 'mean_word_length': 2.735632183908046, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '2926573', 'n_tokens_mistral': 476, 'n_tokens_neox': 470, 'n_words': 103}