Browse code

corex: readme updated with file_read() and file_write()

Daniel-Constantin Mierla authored on 07/09/2015 12:58:34
Showing 1 changed files
... ...
@@ -46,6 +46,8 @@ Muhammad Shahzad Shafi
46 46
               4.6. msg_iflag_set(flagname)
47 47
               4.7. msg_iflag_reset(flagname)
48 48
               4.8. msg_iflag_is_set(flagname)
49
+              4.9. file_read(fpath, var)
50
+              4.10. file_write(fpath, content)
49 51
 
50 52
         5. RPC Commands
51 53
 
... ...
@@ -73,8 +75,10 @@ Muhammad Shahzad Shafi
73 73
    1.9. msg_iflag_set usage
74 74
    1.10. msg_iflag_reset usage
75 75
    1.11. msg_iflag_is_set usage
76
-   1.12. event_route[network:msg] use cases
77
-   1.13. Sample PERL code for do_compress and do_uncompress
76
+   1.12. file_read usage
77
+   1.13. file_write usage
78
+   1.14. event_route[network:msg] use cases
79
+   1.15. Sample PERL code for do_compress and do_uncompress
78 80
 
79 81
 Chapter 1. Admin Guide
80 82
 
... ...
@@ -103,6 +107,8 @@ Chapter 1. Admin Guide
103 103
         4.6. msg_iflag_set(flagname)
104 104
         4.7. msg_iflag_reset(flagname)
105 105
         4.8. msg_iflag_is_set(flagname)
106
+        4.9. file_read(fpath, var)
107
+        4.10. file_write(fpath, content)
106 108
 
107 109
    5. RPC Commands
108 110
 
... ...
@@ -228,6 +234,8 @@ modparam("corex", "msg_avp", "$avp(msg)")
228 228
    4.6. msg_iflag_set(flagname)
229 229
    4.7. msg_iflag_reset(flagname)
230 230
    4.8. msg_iflag_is_set(flagname)
231
+   4.9. file_read(fpath, var)
232
+   4.10. file_write(fpath, content)
231 233
 
232 234
 4.1. append_branch([ uri, [ q ] ])
233 235
 
... ...
@@ -352,6 +360,28 @@ event_route[network:msg] {
352 352
     if(msg_iflag_is_set("UAC_AUTH")) { ... }
353 353
 ...
354 354
 
355
+4.9. file_read(fpath, var)
356
+
357
+   Read content of a text file into a variable.
358
+
359
+   This function can be used from ANY_ROUTE.
360
+
361
+   Example 1.12. file_read usage
362
+...
363
+if(file_read("/tmp/data.txt", "$var(data)")) { ... }
364
+...
365
+
366
+4.10. file_write(fpath, content)
367
+
368
+   Write content of parameter to a text file.
369
+
370
+   This function can be used from ANY_ROUTE.
371
+
372
+   Example 1.13. file_write usage
373
+...
374
+if(file_write("/tmp/data.txt", "Data is: $var(data)")) { ... }
375
+...
376
+
355 377
 5. RPC Commands
356 378
 
357 379
    5.1. corex.list_sockets
... ...
@@ -461,7 +491,7 @@ event_route[network:msg] {
461 461
    Next is a basic usage example where encoding and decoding is done using
462 462
    PERL,
463 463
 
464
-   Example 1.12. event_route[network:msg] use cases
464
+   Example 1.14. event_route[network:msg] use cases
465 465
 ...
466 466
 loadmodule "app_perl.so"
467 467
 loadmodule "corex.so"
... ...
@@ -492,7 +522,7 @@ event_route[network:msg] {
492 492
 }
493 493
 ...
494 494
 
495
-   Example 1.13. Sample PERL code for do_compress and do_uncompress
495
+   Example 1.15. Sample PERL code for do_compress and do_uncompress
496 496
 ...
497 497
 use strict;
498 498
 use warnings;