Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'rm' tool from conan.tools.files #2617

Merged
merged 2 commits into from Jun 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions reference/conanfile/tools/files/basic.rst
Expand Up @@ -138,6 +138,31 @@ Parameters:
- **encoding** (Optional, Defaulted to ``utf-8``): Specifies the input and output files text encoding.


conan.tools.files.rm()
----------------------

.. code-block:: python

def rm(conanfile, pattern, folder, recursive=False)


Remove the files following the ``pattern`` (fnmatch) from the specified ``folder``.

.. code-block:: python

from conan.tools.files import rm

rm(self, "*.tmp", self.build_folder, recursive=True)


Parameters:
- **conanfile**: Conanfile object.
- **pattern** (Required): Pattern that the files to be removed have to match (fnmatch).
- **folder**: Folder to search/remove the files.
- **recursive**: If ``recursive`` is specified it will search in the subfolders.
lasote marked this conversation as resolved.
Show resolved Hide resolved



conan.tools.files.mkdir()
-------------------------

Expand Down