documentation: add JS api docs
[oweals/luci.git] / documentation / jsapi / LuCI.fs.html
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4     <meta charset="utf-8">
5     <title>JSDoc: Class: fs</title>
6
7     <script src="scripts/prettify/prettify.js"> </script>
8     <script src="scripts/prettify/lang-css.js"> </script>
9     <!--[if lt IE 9]>
10       <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11     <![endif]-->
12     <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13     <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14 </head>
15
16 <body>
17
18 <div id="main">
19
20     <h1 class="page-title">Class: fs</h1>
21
22     
23
24
25
26
27 <section>
28
29 <header>
30     
31         <h2><span class="attribs"><span class="type-signature"></span></span>
32             <span class="ancestors"><a href="LuCI.html">LuCI</a>.</span>fs</h2>
33         
34             <div class="class-description"><p>Provides high level utilities to wrap file system related RPC calls.
35 To import the class in views, use <code>'require fs'</code>, to import it in
36 external JavaScript, use <code>L.require(&quot;fs&quot;).then(...)</code>.</p></div>
37         
38     
39 </header>
40
41 <article>
42     <div class="container-overview">
43     
44         
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 <dl class="details">
61
62     
63
64     
65
66     
67
68     
69
70     
71
72     
73
74     
75
76     
77
78     
79
80     
81
82     
83
84     
85
86     
87     <dt class="tag-source">Source:</dt>
88     <dd class="tag-source"><ul class="dummy"><li>
89         <a href="fs.js.html">fs.js</a>, <a href="fs.js.html#line111">line 111</a>
90     </li></ul></dd>
91     
92
93     
94
95     
96
97     
98 </dl>
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119     
120     </div>
121
122     
123
124     
125
126     
127
128     
129
130     
131
132     
133
134     
135
136     
137         <h3 class="subsection-title">Methods</h3>
138
139         
140             
141
142     
143
144     
145     <h4 class="name" id="exec"><span class="type-signature"></span>exec<span class="signature">(command, params<span class="signature-attributes">opt</span>, env<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="LuCI.fs.html#.FileExecResult">LuCI.fs.FileExecResult</a>>}</span></h4>
146     
147
148     
149
150
151
152 <div class="description">
153     <p>Execute the specified command, optionally passing params and
154 environment variables.</p>
155 <p>Note: The <code>command</code> must be either the path to an executable,
156 or a basename without arguments in which case it will be searched
157 in $PATH. If specified, the values given in <code>params</code> will be passed
158 as arguments to the command.</p>
159 <p>The key/value pairs in the optional <code>env</code> table are translated to
160 <code>setenv()</code> calls prior to running the command.</p>
161 </div>
162
163
164
165
166
167
168
169
170
171     <h5>Parameters:</h5>
172     
173
174 <table class="params">
175     <thead>
176     <tr>
177         
178         <th>Name</th>
179         
180
181         <th>Type</th>
182
183         
184         <th>Attributes</th>
185         
186
187         
188
189         <th class="last">Description</th>
190     </tr>
191     </thead>
192
193     <tbody>
194     
195
196         <tr>
197             
198                 <td class="name"><code>command</code></td>
199             
200
201             <td class="type">
202             
203                 
204 <span class="param-type">string</span>
205
206
207             
208             </td>
209
210             
211                 <td class="attributes">
212                 
213
214                 
215
216                 
217                 </td>
218             
219
220             
221
222             <td class="description last"><p>The command to invoke.</p></td>
223         </tr>
224
225     
226
227         <tr>
228             
229                 <td class="name"><code>params</code></td>
230             
231
232             <td class="type">
233             
234                 
235 <span class="param-type">Array.&lt;string></span>
236
237
238             
239             </td>
240
241             
242                 <td class="attributes">
243                 
244                     &lt;optional><br>
245                 
246
247                 
248
249                 
250                 </td>
251             
252
253             
254
255             <td class="description last"><p>The arguments to pass to the command.</p></td>
256         </tr>
257
258     
259
260         <tr>
261             
262                 <td class="name"><code>env</code></td>
263             
264
265             <td class="type">
266             
267                 
268 <span class="param-type">Object.&lt;string, string></span>
269
270
271             
272             </td>
273
274             
275                 <td class="attributes">
276                 
277                     &lt;optional><br>
278                 
279
280                 
281
282                 
283                 </td>
284             
285
286             
287
288             <td class="description last"><p>Environment variables to set.</p></td>
289         </tr>
290
291     
292     </tbody>
293 </table>
294
295
296
297
298
299
300 <dl class="details">
301
302     
303
304     
305
306     
307
308     
309
310     
311
312     
313
314     
315
316     
317
318     
319
320     
321
322     
323
324     
325
326     
327     <dt class="tag-source">Source:</dt>
328     <dd class="tag-source"><ul class="dummy"><li>
329         <a href="fs.js.html">fs.js</a>, <a href="fs.js.html#line232">line 232</a>
330     </li></ul></dd>
331     
332
333     
334
335     
336
337     
338 </dl>
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354 <h5>Returns:</h5>
355
356         
357 <div class="param-desc">
358     <p>Returns a promise resolving to an object describing the execution
359 results or rejecting with an error stating the failure reason.</p>
360 </div>
361
362
363
364 <dl>
365     <dt>
366         Type
367     </dt>
368     <dd>
369         
370 <span class="param-type">Promise.&lt;<a href="LuCI.fs.html#.FileExecResult">LuCI.fs.FileExecResult</a>></span>
371
372
373     </dd>
374 </dl>
375
376     
377
378
379
380
381
382         
383             
384
385     
386
387     
388     <h4 class="name" id="lines"><span class="type-signature"></span>lines<span class="signature">(path)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;string>>}</span></h4>
389     
390
391     
392
393
394
395 <div class="description">
396     <p>Read the contents of the given file, split it into lines, trim
397 leading and trailing white space of each line and return the
398 resulting array.</p>
399 <p>This function is guaranteed to not reject its promises, on failure,
400 an empty array will be returned.</p>
401 </div>
402
403
404
405
406
407
408
409
410
411     <h5>Parameters:</h5>
412     
413
414 <table class="params">
415     <thead>
416     <tr>
417         
418         <th>Name</th>
419         
420
421         <th>Type</th>
422
423         
424
425         
426
427         <th class="last">Description</th>
428     </tr>
429     </thead>
430
431     <tbody>
432     
433
434         <tr>
435             
436                 <td class="name"><code>path</code></td>
437             
438
439             <td class="type">
440             
441                 
442 <span class="param-type">string</span>
443
444
445             
446             </td>
447
448             
449
450             
451
452             <td class="description last"><p>The file path to read.</p></td>
453         </tr>
454
455     
456     </tbody>
457 </table>
458
459
460
461
462
463
464 <dl class="details">
465
466     
467
468     
469
470     
471
472     
473
474     
475
476     
477
478     
479
480     
481
482     
483
484     
485
486     
487
488     
489
490     
491     <dt class="tag-source">Source:</dt>
492     <dd class="tag-source"><ul class="dummy"><li>
493         <a href="fs.js.html">fs.js</a>, <a href="fs.js.html#line281">line 281</a>
494     </li></ul></dd>
495     
496
497     
498
499     
500
501     
502 </dl>
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518 <h5>Returns:</h5>
519
520         
521 <div class="param-desc">
522     <p>Returns a promise resolving to an array containing the stripped lines
523 of the given file or <code>[]</code> on failure.</p>
524 </div>
525
526
527
528 <dl>
529     <dt>
530         Type
531     </dt>
532     <dd>
533         
534 <span class="param-type">Promise.&lt;Array.&lt;string>></span>
535
536
537     </dd>
538 </dl>
539
540     
541
542
543
544
545
546         
547             
548
549     
550
551     
552     <h4 class="name" id="list"><span class="type-signature"></span>list<span class="signature">(path)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="LuCI.fs.html#.FileStatEntry">LuCI.fs.FileStatEntry</a>>>}</span></h4>
553     
554
555     
556
557
558
559 <div class="description">
560     <p>Obtains a listing of the specified directory.</p>
561 </div>
562
563
564
565
566
567
568
569
570
571     <h5>Parameters:</h5>
572     
573
574 <table class="params">
575     <thead>
576     <tr>
577         
578         <th>Name</th>
579         
580
581         <th>Type</th>
582
583         
584
585         
586
587         <th class="last">Description</th>
588     </tr>
589     </thead>
590
591     <tbody>
592     
593
594         <tr>
595             
596                 <td class="name"><code>path</code></td>
597             
598
599             <td class="type">
600             
601                 
602 <span class="param-type">string</span>
603
604
605             
606             </td>
607
608             
609
610             
611
612             <td class="description last"><p>The directory path to list.</p></td>
613         </tr>
614
615     
616     </tbody>
617 </table>
618
619
620
621
622
623
624 <dl class="details">
625
626     
627
628     
629
630     
631
632     
633
634     
635
636     
637
638     
639
640     
641
642     
643
644     
645
646     
647
648     
649
650     
651     <dt class="tag-source">Source:</dt>
652     <dd class="tag-source"><ul class="dummy"><li>
653         <a href="fs.js.html">fs.js</a>, <a href="fs.js.html#line132">line 132</a>
654     </li></ul></dd>
655     
656
657     
658
659     
660
661     
662 </dl>
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678 <h5>Returns:</h5>
679
680         
681 <div class="param-desc">
682     <p>Returns a promise resolving to an array of stat detail objects or
683 rejecting with an error stating the failure reason.</p>
684 </div>
685
686
687
688 <dl>
689     <dt>
690         Type
691     </dt>
692     <dd>
693         
694 <span class="param-type">Promise.&lt;Array.&lt;<a href="LuCI.fs.html#.FileStatEntry">LuCI.fs.FileStatEntry</a>>></span>
695
696
697     </dd>
698 </dl>
699
700     
701
702
703
704
705
706         
707             
708
709     
710
711     
712     <h4 class="name" id="read"><span class="type-signature"></span>read<span class="signature">(path)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
713     
714
715     
716
717
718
719 <div class="description">
720     <p>Read the contents of the given file and return them.
721 Note: this function is unsuitable for obtaining binary data.</p>
722 </div>
723
724
725
726
727
728
729
730
731
732     <h5>Parameters:</h5>
733     
734
735 <table class="params">
736     <thead>
737     <tr>
738         
739         <th>Name</th>
740         
741
742         <th>Type</th>
743
744         
745
746         
747
748         <th class="last">Description</th>
749     </tr>
750     </thead>
751
752     <tbody>
753     
754
755         <tr>
756             
757                 <td class="name"><code>path</code></td>
758             
759
760             <td class="type">
761             
762                 
763 <span class="param-type">string</span>
764
765
766             
767             </td>
768
769             
770
771             
772
773             <td class="description last"><p>The file path to read.</p></td>
774         </tr>
775
776     
777     </tbody>
778 </table>
779
780
781
782
783
784
785 <dl class="details">
786
787     
788
789     
790
791     
792
793     
794
795     
796
797     
798
799     
800
801     
802
803     
804
805     
806
807     
808
809     
810
811     
812     <dt class="tag-source">Source:</dt>
813     <dd class="tag-source"><ul class="dummy"><li>
814         <a href="fs.js.html">fs.js</a>, <a href="fs.js.html#line161">line 161</a>
815     </li></ul></dd>
816     
817
818     
819
820     
821
822     
823 </dl>
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839 <h5>Returns:</h5>
840
841         
842 <div class="param-desc">
843     <p>Returns a promise resolving to a string containing the file contents or
844 rejecting with an error stating the failure reason.</p>
845 </div>
846
847
848
849 <dl>
850     <dt>
851         Type
852     </dt>
853     <dd>
854         
855 <span class="param-type">Promise.&lt;string></span>
856
857
858     </dd>
859 </dl>
860
861     
862
863
864
865
866
867         
868             
869
870     
871
872     
873     <h4 class="name" id="remove"><span class="type-signature"></span>remove<span class="signature">(The)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span></h4>
874     
875
876     
877
878
879
880 <div class="description">
881     <p>Unlink the given file.</p>
882 </div>
883
884
885
886
887
888
889
890
891
892     <h5>Parameters:</h5>
893     
894
895 <table class="params">
896     <thead>
897     <tr>
898         
899         <th>Name</th>
900         
901
902         <th>Type</th>
903
904         
905
906         
907
908         <th class="last">Description</th>
909     </tr>
910     </thead>
911
912     <tbody>
913     
914
915         <tr>
916             
917                 <td class="name"><code>The</code></td>
918             
919
920             <td class="type">
921             
922                 
923 <span class="param-type">string</span>
924
925
926             
927             </td>
928
929             
930
931             
932
933             <td class="description last"><p>file path to remove.</p></td>
934         </tr>
935
936     
937     </tbody>
938 </table>
939
940
941
942
943
944
945 <dl class="details">
946
947     
948
949     
950
951     
952
953     
954
955     
956
957     
958
959     
960
961     
962
963     
964
965     
966
967     
968
969     
970
971     
972     <dt class="tag-source">Source:</dt>
973     <dd class="tag-source"><ul class="dummy"><li>
974         <a href="fs.js.html">fs.js</a>, <a href="fs.js.html#line203">line 203</a>
975     </li></ul></dd>
976     
977
978     
979
980     
981
982     
983 </dl>
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999 <h5>Returns:</h5>
1000
1001         
1002 <div class="param-desc">
1003     <p>Returns a promise resolving to <code>0</code> or rejecting with an error stating
1004 the failure reason.</p>
1005 </div>
1006
1007
1008
1009 <dl>
1010     <dt>
1011         Type
1012     </dt>
1013     <dd>
1014         
1015 <span class="param-type">Promise.&lt;number></span>
1016
1017
1018     </dd>
1019 </dl>
1020
1021     
1022
1023
1024
1025
1026
1027         
1028             
1029
1030     
1031
1032     
1033     <h4 class="name" id="stat"><span class="type-signature"></span>stat<span class="signature">(path)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="LuCI.fs.html#.FileStatEntry">LuCI.fs.FileStatEntry</a>>}</span></h4>
1034     
1035
1036     
1037
1038
1039
1040 <div class="description">
1041     <p>Return file stat information on the specified path.</p>
1042 </div>
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052     <h5>Parameters:</h5>
1053     
1054
1055 <table class="params">
1056     <thead>
1057     <tr>
1058         
1059         <th>Name</th>
1060         
1061
1062         <th>Type</th>
1063
1064         
1065
1066         
1067
1068         <th class="last">Description</th>
1069     </tr>
1070     </thead>
1071
1072     <tbody>
1073     
1074
1075         <tr>
1076             
1077                 <td class="name"><code>path</code></td>
1078             
1079
1080             <td class="type">
1081             
1082                 
1083 <span class="param-type">string</span>
1084
1085
1086             
1087             </td>
1088
1089             
1090
1091             
1092
1093             <td class="description last"><p>The filesystem path to stat.</p></td>
1094         </tr>
1095
1096     
1097     </tbody>
1098 </table>
1099
1100
1101
1102
1103
1104
1105 <dl class="details">
1106
1107     
1108
1109     
1110
1111     
1112
1113     
1114
1115     
1116
1117     
1118
1119     
1120
1121     
1122
1123     
1124
1125     
1126
1127     
1128
1129     
1130
1131     
1132     <dt class="tag-source">Source:</dt>
1133     <dd class="tag-source"><ul class="dummy"><li>
1134         <a href="fs.js.html">fs.js</a>, <a href="fs.js.html#line146">line 146</a>
1135     </li></ul></dd>
1136     
1137
1138     
1139
1140     
1141
1142     
1143 </dl>
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159 <h5>Returns:</h5>
1160
1161         
1162 <div class="param-desc">
1163     <p>Returns a promise resolving to a stat detail object or
1164 rejecting with an error stating the failure reason.</p>
1165 </div>
1166
1167
1168
1169 <dl>
1170     <dt>
1171         Type
1172     </dt>
1173     <dd>
1174         
1175 <span class="param-type">Promise.&lt;<a href="LuCI.fs.html#.FileStatEntry">LuCI.fs.FileStatEntry</a>></span>
1176
1177
1178     </dd>
1179 </dl>
1180
1181     
1182
1183
1184
1185
1186
1187         
1188             
1189
1190     
1191
1192     
1193     <h4 class="name" id="trimmed"><span class="type-signature"></span>trimmed<span class="signature">(path)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
1194     
1195
1196     
1197
1198
1199
1200 <div class="description">
1201     <p>Read the contents of the given file, trim leading and trailing white
1202 space and return the trimmed result. In case of errors, return an empty
1203 string instead.</p>
1204 <p>Note: this function is useful to read single-value files in <code>/sys</code>
1205 or <code>/proc</code>.</p>
1206 <p>This function is guaranteed to not reject its promises, on failure,
1207 an empty string will be returned.</p>
1208 </div>
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218     <h5>Parameters:</h5>
1219     
1220
1221 <table class="params">
1222     <thead>
1223     <tr>
1224         
1225         <th>Name</th>
1226         
1227
1228         <th>Type</th>
1229
1230         
1231
1232         
1233
1234         <th class="last">Description</th>
1235     </tr>
1236     </thead>
1237
1238     <tbody>
1239     
1240
1241         <tr>
1242             
1243                 <td class="name"><code>path</code></td>
1244             
1245
1246             <td class="type">
1247             
1248                 
1249 <span class="param-type">string</span>
1250
1251
1252             
1253             </td>
1254
1255             
1256
1257             
1258
1259             <td class="description last"><p>The file path to read.</p></td>
1260         </tr>
1261
1262     
1263     </tbody>
1264 </table>
1265
1266
1267
1268
1269
1270
1271 <dl class="details">
1272
1273     
1274
1275     
1276
1277     
1278
1279     
1280
1281     
1282
1283     
1284
1285     
1286
1287     
1288
1289     
1290
1291     
1292
1293     
1294
1295     
1296
1297     
1298     <dt class="tag-source">Source:</dt>
1299     <dd class="tag-source"><ul class="dummy"><li>
1300         <a href="fs.js.html">fs.js</a>, <a href="fs.js.html#line260">line 260</a>
1301     </li></ul></dd>
1302     
1303
1304     
1305
1306     
1307
1308     
1309 </dl>
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325 <h5>Returns:</h5>
1326
1327         
1328 <div class="param-desc">
1329     <p>Returns a promise resolving to the file contents or the empty string
1330 on failure.</p>
1331 </div>
1332
1333
1334
1335 <dl>
1336     <dt>
1337         Type
1338     </dt>
1339     <dd>
1340         
1341 <span class="param-type">Promise.&lt;string></span>
1342
1343
1344     </dd>
1345 </dl>
1346
1347     
1348
1349
1350
1351
1352
1353         
1354             
1355
1356     
1357
1358     
1359     <h4 class="name" id="write"><span class="type-signature"></span>write<span class="signature">(path, data<span class="signature-attributes">opt</span>, mode<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span></h4>
1360     
1361
1362     
1363
1364
1365
1366 <div class="description">
1367     <p>Write the given data to the specified file path.
1368 If the specified file path does not exist, it will be created, given
1369 sufficient permissions.</p>
1370 <p>Note: <code>data</code> will be converted to a string using <code>String(data)</code> or to
1371 <code>''</code> when it is <code>null</code>.</p>
1372 </div>
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382     <h5>Parameters:</h5>
1383     
1384
1385 <table class="params">
1386     <thead>
1387     <tr>
1388         
1389         <th>Name</th>
1390         
1391
1392         <th>Type</th>
1393
1394         
1395         <th>Attributes</th>
1396         
1397
1398         
1399
1400         <th class="last">Description</th>
1401     </tr>
1402     </thead>
1403
1404     <tbody>
1405     
1406
1407         <tr>
1408             
1409                 <td class="name"><code>path</code></td>
1410             
1411
1412             <td class="type">
1413             
1414                 
1415 <span class="param-type">string</span>
1416
1417
1418             
1419             </td>
1420
1421             
1422                 <td class="attributes">
1423                 
1424
1425                 
1426
1427                 
1428                 </td>
1429             
1430
1431             
1432
1433             <td class="description last"><p>The file path to write to.</p></td>
1434         </tr>
1435
1436     
1437
1438         <tr>
1439             
1440                 <td class="name"><code>data</code></td>
1441             
1442
1443             <td class="type">
1444             
1445                 
1446 <span class="param-type">*</span>
1447
1448
1449             
1450             </td>
1451
1452             
1453                 <td class="attributes">
1454                 
1455                     &lt;optional><br>
1456                 
1457
1458                 
1459
1460                 
1461                 </td>
1462             
1463
1464             
1465
1466             <td class="description last"><p>The file data to write. If it is null, it will be set to an empty
1467 string.</p></td>
1468         </tr>
1469
1470     
1471
1472         <tr>
1473             
1474                 <td class="name"><code>mode</code></td>
1475             
1476
1477             <td class="type">
1478             
1479                 
1480 <span class="param-type">number</span>
1481
1482
1483             
1484             </td>
1485
1486             
1487                 <td class="attributes">
1488                 
1489                     &lt;optional><br>
1490                 
1491
1492                 
1493
1494                 
1495                 </td>
1496             
1497
1498             
1499
1500             <td class="description last"><p>The permissions to use on file creation. Default is 420 (0644).</p></td>
1501         </tr>
1502
1503     
1504     </tbody>
1505 </table>
1506
1507
1508
1509
1510
1511
1512 <dl class="details">
1513
1514     
1515
1516     
1517
1518     
1519
1520     
1521
1522     
1523
1524     
1525
1526     
1527
1528     
1529
1530     
1531
1532     
1533
1534     
1535
1536     
1537
1538     
1539     <dt class="tag-source">Source:</dt>
1540     <dd class="tag-source"><ul class="dummy"><li>
1541         <a href="fs.js.html">fs.js</a>, <a href="fs.js.html#line187">line 187</a>
1542     </li></ul></dd>
1543     
1544
1545     
1546
1547     
1548
1549     
1550 </dl>
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566 <h5>Returns:</h5>
1567
1568         
1569 <div class="param-desc">
1570     <p>Returns a promise resolving to <code>0</code> or rejecting with an error stating
1571 the failure reason.</p>
1572 </div>
1573
1574
1575
1576 <dl>
1577     <dt>
1578         Type
1579     </dt>
1580     <dd>
1581         
1582 <span class="param-type">Promise.&lt;number></span>
1583
1584
1585     </dd>
1586 </dl>
1587
1588     
1589
1590
1591
1592
1593
1594         
1595     
1596
1597     
1598         <h3 class="subsection-title">Type Definitions</h3>
1599
1600         
1601                 
1602 <h4 class="name" id=".FileExecResult">FileExecResult</h4>
1603
1604
1605
1606
1607
1608
1609     <h5>Type:</h5>
1610     <ul>
1611         <li>
1612             
1613 <span class="param-type">Object</span>
1614
1615
1616         </li>
1617     </ul>
1618
1619
1620
1621
1622
1623     <h5 class="subsection-title">Properties:</h5>
1624
1625     
1626
1627 <table class="props">
1628     <thead>
1629     <tr>
1630         
1631         <th>Name</th>
1632         
1633
1634         <th>Type</th>
1635
1636         
1637         <th>Attributes</th>
1638         
1639
1640         
1641
1642         <th class="last">Description</th>
1643     </tr>
1644     </thead>
1645
1646     <tbody>
1647     
1648
1649         <tr>
1650             
1651                 <td class="name"><code>code</code></td>
1652             
1653
1654             <td class="type">
1655             
1656                 
1657 <span class="param-type">number</span>
1658
1659
1660             
1661             </td>
1662
1663             
1664                 <td class="attributes">
1665                 
1666
1667                 
1668                 </td>
1669             
1670
1671             
1672
1673             <td class="description last"><p>The exit code of the invoked command</p></td>
1674         </tr>
1675
1676     
1677
1678         <tr>
1679             
1680                 <td class="name"><code>stdout</code></td>
1681             
1682
1683             <td class="type">
1684             
1685                 
1686 <span class="param-type">string</span>
1687
1688
1689             
1690             </td>
1691
1692             
1693                 <td class="attributes">
1694                 
1695                     &lt;optional><br>
1696                 
1697
1698                 
1699                 </td>
1700             
1701
1702             
1703
1704             <td class="description last"><p>The stdout produced by the command, if any</p></td>
1705         </tr>
1706
1707     
1708
1709         <tr>
1710             
1711                 <td class="name"><code>stderr</code></td>
1712             
1713
1714             <td class="type">
1715             
1716                 
1717 <span class="param-type">string</span>
1718
1719
1720             
1721             </td>
1722
1723             
1724                 <td class="attributes">
1725                 
1726                     &lt;optional><br>
1727                 
1728
1729                 
1730                 </td>
1731             
1732
1733             
1734
1735             <td class="description last"><p>The stderr produced by the command, if any</p></td>
1736         </tr>
1737
1738     
1739     </tbody>
1740 </table>
1741
1742
1743
1744
1745 <dl class="details">
1746
1747     
1748
1749     
1750
1751     
1752
1753     
1754
1755     
1756
1757     
1758
1759     
1760
1761     
1762
1763     
1764
1765     
1766
1767     
1768
1769     
1770
1771     
1772     <dt class="tag-source">Source:</dt>
1773     <dd class="tag-source"><ul class="dummy"><li>
1774         <a href="fs.js.html">fs.js</a>, <a href="fs.js.html#line20">line 20</a>
1775     </li></ul></dd>
1776     
1777
1778     
1779
1780     
1781
1782     
1783 </dl>
1784
1785
1786
1787
1788
1789
1790             
1791                 
1792 <h4 class="name" id=".FileStatEntry">FileStatEntry</h4>
1793
1794
1795
1796
1797
1798
1799     <h5>Type:</h5>
1800     <ul>
1801         <li>
1802             
1803 <span class="param-type">Object</span>
1804
1805
1806         </li>
1807     </ul>
1808
1809
1810
1811
1812
1813     <h5 class="subsection-title">Properties:</h5>
1814
1815     
1816
1817 <table class="props">
1818     <thead>
1819     <tr>
1820         
1821         <th>Name</th>
1822         
1823
1824         <th>Type</th>
1825
1826         
1827
1828         
1829
1830         <th class="last">Description</th>
1831     </tr>
1832     </thead>
1833
1834     <tbody>
1835     
1836
1837         <tr>
1838             
1839                 <td class="name"><code>name</code></td>
1840             
1841
1842             <td class="type">
1843             
1844                 
1845 <span class="param-type">string</span>
1846
1847
1848             
1849             </td>
1850
1851             
1852
1853             
1854
1855             <td class="description last"><p>Name of the directory entry</p></td>
1856         </tr>
1857
1858     
1859
1860         <tr>
1861             
1862                 <td class="name"><code>type</code></td>
1863             
1864
1865             <td class="type">
1866             
1867                 
1868 <span class="param-type">string</span>
1869
1870
1871             
1872             </td>
1873
1874             
1875
1876             
1877
1878             <td class="description last"><p>Type of the entry, one of <code>block</code>, <code>char</code>, <code>directory</code>, <code>fifo</code>, <code>symlink</code>, <code>file</code>, <code>socket</code> or <code>unknown</code></p></td>
1879         </tr>
1880
1881     
1882
1883         <tr>
1884             
1885                 <td class="name"><code>size</code></td>
1886             
1887
1888             <td class="type">
1889             
1890                 
1891 <span class="param-type">number</span>
1892
1893
1894             
1895             </td>
1896
1897             
1898
1899             
1900
1901             <td class="description last"><p>Size in bytes</p></td>
1902         </tr>
1903
1904     
1905
1906         <tr>
1907             
1908                 <td class="name"><code>mode</code></td>
1909             
1910
1911             <td class="type">
1912             
1913                 
1914 <span class="param-type">number</span>
1915
1916
1917             
1918             </td>
1919
1920             
1921
1922             
1923
1924             <td class="description last"><p>Access permissions</p></td>
1925         </tr>
1926
1927     
1928
1929         <tr>
1930             
1931                 <td class="name"><code>atime</code></td>
1932             
1933
1934             <td class="type">
1935             
1936                 
1937 <span class="param-type">number</span>
1938
1939
1940             
1941             </td>
1942
1943             
1944
1945             
1946
1947             <td class="description last"><p>Last access time in seconds since epoch</p></td>
1948         </tr>
1949
1950     
1951
1952         <tr>
1953             
1954                 <td class="name"><code>mtime</code></td>
1955             
1956
1957             <td class="type">
1958             
1959                 
1960 <span class="param-type">number</span>
1961
1962
1963             
1964             </td>
1965
1966             
1967
1968             
1969
1970             <td class="description last"><p>Last modification time in seconds since epoch</p></td>
1971         </tr>
1972
1973     
1974
1975         <tr>
1976             
1977                 <td class="name"><code>ctime</code></td>
1978             
1979
1980             <td class="type">
1981             
1982                 
1983 <span class="param-type">number</span>
1984
1985
1986             
1987             </td>
1988
1989             
1990
1991             
1992
1993             <td class="description last"><p>Last change time in seconds since epoch</p></td>
1994         </tr>
1995
1996     
1997
1998         <tr>
1999             
2000                 <td class="name"><code>inode</code></td>
2001             
2002
2003             <td class="type">
2004             
2005                 
2006 <span class="param-type">number</span>
2007
2008
2009             
2010             </td>
2011
2012             
2013
2014             
2015
2016             <td class="description last"><p>Inode number</p></td>
2017         </tr>
2018
2019     
2020
2021         <tr>
2022             
2023                 <td class="name"><code>uid</code></td>
2024             
2025
2026             <td class="type">
2027             
2028                 
2029 <span class="param-type">number</span>
2030
2031
2032             
2033             </td>
2034
2035             
2036
2037             
2038
2039             <td class="description last"><p>Numeric owner id</p></td>
2040         </tr>
2041
2042     
2043
2044         <tr>
2045             
2046                 <td class="name"><code>gid</code></td>
2047             
2048
2049             <td class="type">
2050             
2051                 
2052 <span class="param-type">number</span>
2053
2054
2055             
2056             </td>
2057
2058             
2059
2060             
2061
2062             <td class="description last"><p>Numeric group id</p></td>
2063         </tr>
2064
2065     
2066     </tbody>
2067 </table>
2068
2069
2070
2071
2072 <dl class="details">
2073
2074     
2075
2076     
2077
2078     
2079
2080     
2081
2082     
2083
2084     
2085
2086     
2087
2088     
2089
2090     
2091
2092     
2093
2094     
2095
2096     
2097
2098     
2099     <dt class="tag-source">Source:</dt>
2100     <dd class="tag-source"><ul class="dummy"><li>
2101         <a href="fs.js.html">fs.js</a>, <a href="fs.js.html#line4">line 4</a>
2102     </li></ul></dd>
2103     
2104
2105     
2106
2107     
2108
2109     
2110 </dl>
2111
2112
2113
2114
2115
2116
2117             
2118     
2119
2120     
2121 </article>
2122
2123 </section>
2124
2125
2126
2127
2128 </div>
2129
2130 <nav>
2131     <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="LuCI.html">LuCI</a></li><li><a href="LuCI.Class.html">Class</a></li><li><a href="LuCI.dom.html">dom</a></li><li><a href="LuCI.fs.html">fs</a></li><li><a href="LuCI.Headers.html">Headers</a></li><li><a href="LuCI.Network.html">Network</a></li><li><a href="LuCI.Network.Device.html">Device</a></li><li><a href="LuCI.Network.Hosts.html">Hosts</a></li><li><a href="LuCI.Network.Protocol.html">Protocol</a></li><li><a href="LuCI.Network.WifiDevice.html">WifiDevice</a></li><li><a href="LuCI.Network.WifiNetwork.html">WifiNetwork</a></li><li><a href="LuCI.Poll.html">Poll</a></li><li><a href="LuCI.Request.html">Request</a></li><li><a href="LuCI.Request.poll.html">poll</a></li><li><a href="LuCI.Response.html">Response</a></li><li><a href="LuCI.rpc.html">rpc</a></li><li><a href="LuCI.uci.html">uci</a></li><li><a href="LuCI.view.html">view</a></li><li><a href="LuCI.XHR.html">XHR</a></li></ul>
2132 </nav>
2133
2134 <br class="clear">
2135
2136 <footer>
2137     Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time)
2138 </footer>
2139
2140 <script> prettyPrint(); </script>
2141 <script src="scripts/linenumber.js"> </script>
2142 </body>
2143 </html>