@@ -106,19 +106,26 @@ Usage:
106
106
conan.tools.files.rm()
107
107
----------------------
108
108
109
- .. currentmodule :: conan.tools.files.files
109
+ This function removes files from the filesystem. It can be used to remove a single file or a pattern based on fnmatch.
110
+ It's indicated to use it instead of ``os.remove `` because it's cross-platform and may avoid permissions issues.
110
111
111
- .. autofunction :: rm
112
+ .. code-block :: python
113
+ :caption: * Remove all files finished in .tmp in build_folder and recursively*
112
114
115
+ from conan.tools.files import rm
113
116
114
- Usage:
117
+ rm( self , " *.tmp " , self .build_folder, recursive = True )
115
118
116
119
.. code-block :: python
120
+ :caption: * Remove all files from bin_folder, except for any finished by .dll*
117
121
118
122
from conan.tools.files import rm
119
123
120
- rm(self , " *.tmp " , self .build_folder , recursive = True )
124
+ rm(self , " *" , self .bin_folder , recursive = False , excludes = " *.dll " )
121
125
126
+ .. currentmodule:: conan.tools.files.files
127
+
128
+ .. autofunction:: rm
122
129
123
130
124
131
conan.tools.files.mkdir()
@@ -306,7 +313,7 @@ For UNIX libraries starting with **lib**, like *libmath.a*, this tool will colle
306
313
library name **math **. Regarding symlinks, this tool will keep only the "most generic"
307
314
file among the resolved real file and all symlinks pointing to this real file. For example
308
315
among files below, this tool will select *libmath.dylib * file and therefore only append
309
- *math * in the returned list:
316
+ *math * in the returned list:
310
317
311
318
.. code-block :: shell
312
319
0 commit comments