<commit_before>.. _fs:


.. currentmodule:: pyuv


========================================================
:py:mod:`pyuv.fs` --- Asynchronous filesystem operations
========================================================


.. note::
    All functions in the fs module except for the `FSEvent` class support both
    synchronous and asyncronous modes. If you want to run it synchronous don't
    pass any callable as the `callback` argument, else it will run asynchronously.


.. py:function:: pyuv.fs.stat(loop, path, [callback])

    :param string path: File to stat.

    :param loop: loop object where this function runs.

    :param callable callback: Function that will be called with the result of the function.

    stat syscall.

    Callback signature: ``callback(loop, path, stat_result, errorno)``


.. py:function:: pyuv.fs.lstat(path, loop, [callback])

    Same as :py:func:`pyuv.fs.stat` but it also follows symlinks.


.. py:function:: pyuv.fs.fstat(fd, loop, [callback])

    Same as :py:func:`pyuv.fs.stat` but using a file-descriptor instead of the path.

<commit_msg>Added note on file descriptor handling<commit_after>.. _fs:


.. currentmodule:: pyuv


========================================================
:py:mod:`pyuv.fs` --- Asynchronous filesystem operations
========================================================


.. note::
    All functions in the fs module except for the `FSEvent` class support both
    synchronous and asyncronous modes. If you want to run it synchronous don't
    pass any callable as the `callback` argument, else it will run asynchronously.

.. note::
    All functions that take a file descriptor argument must get the file descriptor
    resulting of a pyuv.fs.open call on Windows, else the operation will fail. This
    limitation doesn't apply to Unix systems.


.. py:function:: pyuv.fs.stat(loop, path, [callback])

    :param string path: File to stat.

    :param loop: loop object where this function runs.

    :param callable callback: Function that will be called with the result of the function.

    stat syscall.

    Callback signature: ``callback(loop, path, stat_result, errorno)``


.. py:function:: pyuv.fs.lstat(path, loop, [callback])

    Same as :py:func:`pyuv.fs.stat` but it also follows symlinks.


.. py:function:: pyuv.fs.fstat(fd, loop, [callback])

    Same as :py:func:`pyuv.fs.stat` but using a file-descriptor instead of the path.


{'fraction_non_alphanumeric': 0.18466611706512778, 'fraction_numerical': 0.0, 'mean_word_length': 3.9429735234215886, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4684510', 'n_tokens_mistral': 694, 'n_tokens_neox': 648, 'n_words': 264}