Browse code

corex: documented file_read() and file_write()

Daniel-Constantin Mierla authored on 07/09/2015 12:57:07
Showing 1 changed files
... ...
@@ -370,6 +370,46 @@ event_route[network:msg] {
370 370
 		</example>
371 371
 	</section>
372 372
 
373
+	<section id="corex.f.file_read">
374
+		<title>
375
+			<function moreinfo="none">file_read(fpath, var)</function>
376
+		</title>
377
+		<para>
378
+			Read content of a text file into a variable.
379
+		</para>
380
+		<para>
381
+			This function can be used from ANY_ROUTE.
382
+		</para>
383
+		<example>
384
+		<title><function>file_read</function> usage</title>
385
+		<programlisting format="linespecific">
386
+...
387
+if(file_read("/tmp/data.txt", "$var(data)")) { ... }
388
+...
389
+</programlisting>
390
+		</example>
391
+	</section>
392
+
393
+	<section id="corex.f.file_write">
394
+		<title>
395
+			<function moreinfo="none">file_write(fpath, content)</function>
396
+		</title>
397
+		<para>
398
+			Write content of parameter to a text file.
399
+		</para>
400
+		<para>
401
+			This function can be used from ANY_ROUTE.
402
+		</para>
403
+		<example>
404
+		<title><function>file_write</function> usage</title>
405
+		<programlisting format="linespecific">
406
+...
407
+if(file_write("/tmp/data.txt", "Data is: $var(data)")) { ... }
408
+...
409
+</programlisting>
410
+		</example>
411
+	</section>
412
+
373 413
 	</section>
374 414
 
375 415
 	<section>