Browse Source

corex: documented file_read() and file_write()

Daniel-Constantin Mierla 10 năm trước cách đây
mục cha
commit
9ea2d8de54
1 tập tin đã thay đổi với 40 bổ sung0 xóa
  1. 40 0
      modules/corex/doc/corex_admin.xml

+ 40 - 0
modules/corex/doc/corex_admin.xml

@@ -370,6 +370,46 @@ event_route[network:msg] {
 		</example>
 	</section>
 
+	<section id="corex.f.file_read">
+		<title>
+			<function moreinfo="none">file_read(fpath, var)</function>
+		</title>
+		<para>
+			Read content of a text file into a variable.
+		</para>
+		<para>
+			This function can be used from ANY_ROUTE.
+		</para>
+		<example>
+		<title><function>file_read</function> usage</title>
+		<programlisting format="linespecific">
+...
+if(file_read("/tmp/data.txt", "$var(data)")) { ... }
+...
+</programlisting>
+		</example>
+	</section>
+
+	<section id="corex.f.file_write">
+		<title>
+			<function moreinfo="none">file_write(fpath, content)</function>
+		</title>
+		<para>
+			Write content of parameter to a text file.
+		</para>
+		<para>
+			This function can be used from ANY_ROUTE.
+		</para>
+		<example>
+		<title><function>file_write</function> usage</title>
+		<programlisting format="linespecific">
+...
+if(file_write("/tmp/data.txt", "Data is: $var(data)")) { ... }
+...
+</programlisting>
+		</example>
+	</section>
+
 	</section>
 
 	<section>