Select one of the symbols to view example projects that use it.
 
Outline
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <jimautoconf.h>
#include <jim-subcmd.h>
#include <jimiocompat.h>
#include <sys/time.h>
#include <unistd.h>
#include <direct.h>
#define F_OK
#define W_OK
#define R_OK
#define S_ISREG
#define S_ISDIR
#define ISWINDOWS
#define ISWINDOWS
#define STAT_MTIME_US
#define STAT_MTIME_US
JimGetFileType(int)
AppendStatElement(Jim_Interp *, Jim_Obj *, const char *, long long)
StoreStatData(Jim_Interp *, Jim_Obj *, const jim_stat_t *)
JimPathLenNoTrailingSlashes(const char *, int)
JimStripTrailingSlashes(Jim_Interp *, Jim_Obj *)
file_cmd_dirname(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_split(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_rootname(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_extension(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_tail(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_normalize(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_join(Jim_Interp *, int, Jim_Obj *const *)
file_access(Jim_Interp *, Jim_Obj *, int)
file_cmd_readable(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_writable(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_executable(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_exists(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_delete(Jim_Interp *, int, Jim_Obj *const *)
#define MKDIR_DEFAULT
#define MKDIR_DEFAULT
mkdir_all(char *)
file_cmd_mkdir(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_tempfile(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_rename(Jim_Interp *, int, Jim_Obj *const *)
file_stat(Jim_Interp *, Jim_Obj *, jim_stat_t *)
#define file_lstat
file_cmd_atime(Jim_Interp *, int, Jim_Obj *const *)
JimSetFileTimes(Jim_Interp *, const char *, long long)
file_cmd_mtime(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_copy(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_size(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_isdirectory(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_isfile(Jim_Interp *, int, Jim_Obj *const *)
file_cmd_type(Jim_Interp *, int, Jim_Obj *const *)
#define file_cmd_lstat
file_cmd_stat(Jim_Interp *, int, Jim_Obj *const *)
file_command_table
Jim_CdCmd(Jim_Interp *, int, Jim_Obj *const *)
Jim_PwdCmd(Jim_Interp *, int, Jim_Obj *const *)
Jim_fileInit(Jim_Interp *)
Files
loading...
SourceVuDevelopment ToolsOpenOCDjimtcl/jim-file.c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
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
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
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
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
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
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
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
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * Implements the file command for jim * * (c) 2008 Steve Bennett <steveb@workware.net.au> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE JIM TCL PROJECT ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * JIM TCL PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as representing * official policies, either expressed or implied, of the Jim Tcl Project. * * Based on code originally from Tcl 6.7: * * Copyright 1987-1991 Regents of the University of California * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies. The University of California * makes no representations about the suitability of this * software for any purpose. It is provided "as is" without * express or implied warranty. *//* ... */ #include <limits.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <errno.h> #include <jimautoconf.h> #include <jim-subcmd.h> #include <jimiocompat.h> 8 includes #ifdef HAVE_UTIMES #include <sys/time.h> #endif #ifdef HAVE_UNISTD_H #include <unistd.h> #elif defined(_MSC_VER) #include <direct.h> #define F_OK 0 #define W_OK 2 #define R_OK 4 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 5 defines#endif/* ... */ # ifndef MAXPATHLEN # define MAXPATHLEN JIM_PATH_LEN # endif #if defined(__MINGW32__) || defined(__MSYS__) || defined(_MSC_VER) #define ISWINDOWS 1 #else #define ISWINDOWS 0 #endif /* extract nanosecond resolution mtime from struct stat */ #if defined(HAVE_STRUCT_STAT_ST_MTIMESPEC) #define STAT_MTIME_US(STAT) ((STAT).st_mtimespec.tv_sec * 1000000ll + (STAT).st_mtimespec.tv_nsec / 1000) #elif defined(HAVE_STRUCT_STAT_ST_MTIM) #define STAT_MTIME_US(STAT) ((STAT).st_mtim.tv_sec * 1000000ll + (STAT).st_mtim.tv_nsec / 1000) #endif /* *---------------------------------------------------------------------- * * JimGetFileType -- * * Given a mode word, returns a string identifying the type of a * file. * * Results: * A static text string giving the file type from mode. * * Side effects: * None. * *---------------------------------------------------------------------- *//* ... */ static const char *JimGetFileType(int mode) { if (S_ISREG(mode)) { return "file"; }if (S_ISREG(mode)) { ... } else if (S_ISDIR(mode)) { return "directory"; }else if (S_ISDIR(mode)) { ... } #ifdef S_ISCHR else if (S_ISCHR(mode)) { return "characterSpecial"; }else if (S_ISCHR(mode)) { ... } /* ... */#endif #ifdef S_ISBLK else if (S_ISBLK(mode)) { return "blockSpecial"; }else if (S_ISBLK(mode)) { ... } /* ... */#endif #ifdef S_ISFIFO else if (S_ISFIFO(mode)) { return "fifo"; }else if (S_ISFIFO(mode)) { ... } /* ... */#endif #ifdef S_ISLNK else if (S_ISLNK(mode)) { return "link"; }else if (S_ISLNK(mode)) { ... } /* ... */#endif #ifdef S_ISSOCK else if (S_ISSOCK(mode)) { return "socket"; }else if (S_ISSOCK(mode)) { ... } /* ... */#endif return "unknown"; }{ ... } /* *---------------------------------------------------------------------- * * StoreStatData -- * * This is a utility procedure that breaks out the fields of a * "stat" structure and stores them in textual form into the * elements of an associative array. * * Results: * Returns a standard Tcl return value. If an error occurs then * a message is left in interp->result. * * Side effects: * Elements of the associative array given by "varName" are modified. * *---------------------------------------------------------------------- *//* ... */ static void AppendStatElement(Jim_Interp *interp, Jim_Obj *listObj, const char *key, jim_wide value) { Jim_ListAppendElement(interp, listObj, Jim_NewStringObj(interp, key, -1)); Jim_ListAppendElement(interp, listObj, Jim_NewIntObj(interp, value)); }{ ... } static int StoreStatData(Jim_Interp *interp, Jim_Obj *varName, const jim_stat_t *sb) { /* Just use a list to store the data */ Jim_Obj *listObj = Jim_NewListObj(interp, NULL, 0); AppendStatElement(interp, listObj, "dev", sb->st_dev); AppendStatElement(interp, listObj, "ino", sb->st_ino); AppendStatElement(interp, listObj, "mode", sb->st_mode); AppendStatElement(interp, listObj, "nlink", sb->st_nlink); AppendStatElement(interp, listObj, "uid", sb->st_uid); AppendStatElement(interp, listObj, "gid", sb->st_gid); AppendStatElement(interp, listObj, "size", sb->st_size); AppendStatElement(interp, listObj, "atime", sb->st_atime); AppendStatElement(interp, listObj, "mtime", sb->st_mtime); AppendStatElement(interp, listObj, "ctime", sb->st_ctime); #ifdef STAT_MTIME_US AppendStatElement(interp, listObj, "mtimeus", STAT_MTIME_US(*sb)); #endif Jim_ListAppendElement(interp, listObj, Jim_NewStringObj(interp, "type", -1)); Jim_ListAppendElement(interp, listObj, Jim_NewStringObj(interp, JimGetFileType((int)sb->st_mode), -1)); /* Was a variable specified? */ if (varName) { Jim_Obj *objPtr; objPtr = Jim_GetVariable(interp, varName, JIM_NONE); if (objPtr) { Jim_Obj *objv[2]; objv[0] = objPtr; objv[1] = listObj; objPtr = Jim_DictMerge(interp, 2, objv); if (objPtr == NULL) { /* This message matches the one from Tcl */ Jim_SetResultFormatted(interp, "can't set \"%#s(dev)\": variable isn't array", varName); Jim_FreeNewObj(interp, listObj); return JIM_ERR; }if (objPtr == NULL) { ... } Jim_InvalidateStringRep(objPtr); Jim_FreeNewObj(interp, listObj); listObj = objPtr; }if (objPtr) { ... } Jim_SetVariable(interp, varName, listObj); }if (varName) { ... } /* And also return the value */ Jim_SetResult(interp, listObj); return JIM_OK; }{ ... } /** * Give a path of length 'len', returns the length of the path * with any trailing slashes removed. *//* ... */ static int JimPathLenNoTrailingSlashes(const char *path, int len) { int i; for (i = len; i > 1 && path[i - 1] == '/'; i--) { /* Trailing slash, so remove it */ if (ISWINDOWS && path[i - 2] == ':') { /* But on windows, we won't remove the trailing slash from c:/ */ break; }if (ISWINDOWS && path[i - 2] == ':') { ... } }for (i = len; i > 1 && path[i - 1] == '/'; i--) { ... } return i; }{ ... } /** * Give a path in objPtr, returns a new path with any trailing slash removed. * Use Jim_DecrRefCount() on the returned object (which may be identical to objPtr). *//* ... */ static Jim_Obj *JimStripTrailingSlashes(Jim_Interp *interp, Jim_Obj *objPtr) { int len = Jim_Length(objPtr); const char *path = Jim_String(objPtr); int i = JimPathLenNoTrailingSlashes(path, len); if (i != len) { objPtr = Jim_NewStringObj(interp, path, i); }if (i != len) { ... } Jim_IncrRefCount(objPtr); return objPtr; }{ ... } static int file_cmd_dirname(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { Jim_Obj *objPtr = JimStripTrailingSlashes(interp, argv[0]); const char *path = Jim_String(objPtr); const char *p = strrchr(path, '/'); if (!p) { Jim_SetResultString(interp, ".", -1); }if (!p) { ... } else if (p[1] == 0) { /* Trailing slash so do nothing */ Jim_SetResult(interp, objPtr); }else if (p[1] == 0) { ... } else if (p == path) { Jim_SetResultString(interp, "/", -1); }else if (p == path) { ... } else if (ISWINDOWS && p[-1] == ':') { /* z:/dir => z:/ */ Jim_SetResultString(interp, path, p - path + 1); }else if (ISWINDOWS && p[-1] == ':') { ... } else { /* Strip any trailing slashes from the result */ int len = JimPathLenNoTrailingSlashes(path, p - path); Jim_SetResultString(interp, path, len); }else { ... } Jim_DecrRefCount(interp, objPtr); return JIM_OK; }{ ... } static int file_cmd_split(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { Jim_Obj *listObj = Jim_NewListObj(interp, NULL, 0); const char *path = Jim_String(argv[0]); if (*path == '/') { Jim_ListAppendElement(interp, listObj, Jim_NewStringObj(interp, "/", 1)); }if (*path == '/') { ... } while (1) { /* Remove leading slashes */ while (*path == '/') { path++; }while (*path == '/') { ... } if (*path) { const char *pt = strchr(path, '/'); if (pt) { Jim_ListAppendElement(interp, listObj, Jim_NewStringObj(interp, path, pt - path)); path = pt; continue; }if (pt) { ... } Jim_ListAppendElement(interp, listObj, Jim_NewStringObj(interp, path, -1)); }if (*path) { ... } break; }while (1) { ... } Jim_SetResult(interp, listObj); return JIM_OK; }{ ... } static int file_cmd_rootname(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { const char *path = Jim_String(argv[0]); const char *lastSlash = strrchr(path, '/'); const char *p = strrchr(path, '.'); if (p == NULL || (lastSlash != NULL && lastSlash > p)) { Jim_SetResult(interp, argv[0]); }if (p == NULL || (lastSlash != NULL && lastSlash > p)) { ... } else { Jim_SetResultString(interp, path, p - path); }else { ... } return JIM_OK; }{ ... } static int file_cmd_extension(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { Jim_Obj *objPtr = JimStripTrailingSlashes(interp, argv[0]); const char *path = Jim_String(objPtr); const char *lastSlash = strrchr(path, '/'); const char *p = strrchr(path, '.'); if (p == NULL || (lastSlash != NULL && lastSlash >= p)) { p = ""; }if (p == NULL || (lastSlash != NULL && lastSlash >= p)) { ... } Jim_SetResultString(interp, p, -1); Jim_DecrRefCount(interp, objPtr); return JIM_OK; }{ ... } static int file_cmd_tail(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { Jim_Obj *objPtr = JimStripTrailingSlashes(interp, argv[0]); const char *path = Jim_String(objPtr); const char *lastSlash = strrchr(path, '/'); if (lastSlash) { Jim_SetResultString(interp, lastSlash + 1, -1); }if (lastSlash) { ... } else { Jim_SetResult(interp, objPtr); }else { ... } Jim_DecrRefCount(interp, objPtr); return JIM_OK; }{ ... } static int file_cmd_normalize(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { #ifdef HAVE_REALPATH const char *path = Jim_String(argv[0]); char *newname = Jim_Alloc(MAXPATHLEN + 1); if (realpath(path, newname)) { Jim_SetResult(interp, Jim_NewStringObjNoAlloc(interp, newname, -1)); return JIM_OK; }if (realpath(path, newname)) { ... } else { Jim_Free(newname); Jim_SetResultFormatted(interp, "can't normalize \"%#s\": %s", argv[0], strerror(errno)); return JIM_ERR; }else { ... } /* ... */#else Jim_SetResultString(interp, "Not implemented", -1); return JIM_ERR;/* ... */ #endif }{ ... } static int file_cmd_join(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { int i; char *newname = Jim_Alloc(MAXPATHLEN + 1); char *last = newname; *newname = 0; /* Simple implementation for now */ for (i = 0; i < argc; i++) { int len; const char *part = Jim_GetString(argv[i], &len); if (*part == '/') { /* Absolute component, so go back to the start */ last = newname; }if (*part == '/') { ... } else if (ISWINDOWS && strchr(part, ':')) { /* Absolute component on mingw, so go back to the start */ last = newname; }else if (ISWINDOWS && strchr(part, ':')) { ... } else if (part[0] == '.') { if (part[1] == '/') { part += 2; len -= 2; }if (part[1] == '/') { ... } else if (part[1] == 0 && last != newname) { /* Adding '.' to an existing path does nothing */ continue; }else if (part[1] == 0 && last != newname) { ... } }else if (part[0] == '.') { ... } /* Add a slash if needed */ if (last != newname && last[-1] != '/') { *last++ = '/'; }if (last != newname && last[-1] != '/') { ... } if (len) { if (last + len - newname >= MAXPATHLEN) { Jim_Free(newname); Jim_SetResultString(interp, "Path too long", -1); return JIM_ERR; }if (last + len - newname >= MAXPATHLEN) { ... } memcpy(last, part, len); last += len; }if (len) { ... } /* Remove a slash if needed */ if (last > newname + 1 && last[-1] == '/') { /* but on on Windows, leave the trailing slash on "c:/ " */ if (!ISWINDOWS || !(last > newname + 2 && last[-2] == ':')) { *--last = 0; }if (!ISWINDOWS || !(last > newname + 2 && last[-2] == ':')) { ... } }if (last > newname + 1 && last[-1] == '/') { ... } }for (i = 0; i < argc; i++) { ... } *last = 0; /* Probably need to handle some special cases ... */ Jim_SetResult(interp, Jim_NewStringObjNoAlloc(interp, newname, last - newname)); return JIM_OK; }{ ... } static int file_access(Jim_Interp *interp, Jim_Obj *filename, int mode) { Jim_SetResultBool(interp, access(Jim_String(filename), mode) != -1); return JIM_OK; }{ ... } static int file_cmd_readable(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { return file_access(interp, argv[0], R_OK); }{ ... } static int file_cmd_writable(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { return file_access(interp, argv[0], W_OK); }{ ... } static int file_cmd_executable(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { #ifdef X_OK return file_access(interp, argv[0], X_OK); #else /* If no X_OK, just assume true. */ Jim_SetResultBool(interp, 1); return JIM_OK;/* ... */ #endif }{ ... } static int file_cmd_exists(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { return file_access(interp, argv[0], F_OK); }{ ... } static int file_cmd_delete(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { int force = Jim_CompareStringImmediate(interp, argv[0], "-force"); if (force || Jim_CompareStringImmediate(interp, argv[0], "--")) { argc++; argv--; }if (force || Jim_CompareStringImmediate(interp, argv[0], "--")) { ... } while (argc--) { const char *path = Jim_String(argv[0]); if (unlink(path) == -1 && errno != ENOENT) { if (rmdir(path) == -1) { /* Maybe try using the script helper */ if (!force || Jim_EvalPrefix(interp, "file delete force", 1, argv) != JIM_OK) { Jim_SetResultFormatted(interp, "couldn't delete file \"%s\": %s", path, strerror(errno)); return JIM_ERR; }if (!force || Jim_EvalPrefix(interp, "file delete force", 1, argv) != JIM_OK) { ... } }if (rmdir(path) == -1) { ... } }if (unlink(path) == -1 && errno != ENOENT) { ... } argv++; }while (argc--) { ... } return JIM_OK; }{ ... } #ifdef HAVE_MKDIR_ONE_ARG #define MKDIR_DEFAULT(PATHNAME) mkdir(PATHNAME) #else #define MKDIR_DEFAULT(PATHNAME) mkdir(PATHNAME, 0755) #endif /** * Create directory, creating all intermediate paths if necessary. * * Returns 0 if OK or -1 on failure (and sets errno) * * Note: The path may be modified. *//* ... */ static int mkdir_all(char *path) { int ok = 1; /* First time just try to make the dir */ goto first; while (ok--) { /* Must have failed the first time, so recursively make the parent and try again */ { char *slash = strrchr(path, '/'); if (slash && slash != path) { *slash = 0; if (mkdir_all(path) != 0) { return -1; }if (mkdir_all(path) != 0) { ... } *slash = '/'; }if (slash && slash != path) { ... } }while (ok--) { ... } first: if (MKDIR_DEFAULT(path) == 0) { return 0; }if (MKDIR_DEFAULT(path) == 0) { ... } if (errno == ENOENT) { /* Create the parent and try again */ continue; }if (errno == ENOENT) { ... } /* Maybe it already exists as a directory */ if (errno == EEXIST) { jim_stat_t sb; if (Jim_Stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { return 0; }if (Jim_Stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { ... } /* Restore errno */ errno = EEXIST; }if (errno == EEXIST) { ... } /* Failed */ break; }while (ok--) { ... } return -1; }{ ... } static int file_cmd_mkdir(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { while (argc--) { char *path = Jim_StrDup(Jim_String(argv[0])); int rc = mkdir_all(path); Jim_Free(path); if (rc != 0) { Jim_SetResultFormatted(interp, "can't create directory \"%#s\": %s", argv[0], strerror(errno)); return JIM_ERR; }if (rc != 0) { ... } argv++; }while (argc--) { ... } return JIM_OK; }{ ... } static int file_cmd_tempfile(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { int fd = Jim_MakeTempFile(interp, (argc >= 1) ? Jim_String(argv[0]) : NULL, 0); if (fd < 0) { return JIM_ERR; }if (fd < 0) { ... } close(fd); return JIM_OK; }{ ... } static int file_cmd_rename(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { const char *source; const char *dest; int force = 0; if (argc == 3) { if (!Jim_CompareStringImmediate(interp, argv[0], "-force")) { return -1; }if (!Jim_CompareStringImmediate(interp, argv[0], "-force")) { ... } force++; argv++; argc--; }if (argc == 3) { ... } source = Jim_String(argv[0]); dest = Jim_String(argv[1]); if (!force && access(dest, F_OK) == 0) { Jim_SetResultFormatted(interp, "error renaming \"%#s\" to \"%#s\": target exists", argv[0], argv[1]); return JIM_ERR; }if (!force && access(dest, F_OK) == 0) { ... } #if ISWINDOWS if (access(dest, F_OK) == 0) { /* Windows won't rename over an existing file */ remove(dest); }if (access(dest, F_OK) == 0) { ... } /* ... */#endif if (rename(source, dest) != 0) { Jim_SetResultFormatted(interp, "error renaming \"%#s\" to \"%#s\": %s", argv[0], argv[1], strerror(errno)); return JIM_ERR; }if (rename(source, dest) != 0) { ... } return JIM_OK; }{ ... } #if defined(HAVE_LINK) && defined(HAVE_SYMLINK) static int file_cmd_link(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { int ret; const char *source; const char *dest; static const char * const options[] = { "-hard", "-symbolic", NULL }; enum { OPT_HARD, OPT_SYMBOLIC, }; int option = OPT_HARD; if (argc == 3) { if (Jim_GetEnum(interp, argv[0], options, &option, NULL, JIM_ENUM_ABBREV | JIM_ERRMSG) != JIM_OK) { return JIM_ERR; }if (Jim_GetEnum(interp, argv[0], options, &option, NULL, JIM_ENUM_ABBREV | JIM_ERRMSG) != JIM_OK) { ... } argv++; argc--; }if (argc == 3) { ... } dest = Jim_String(argv[0]); source = Jim_String(argv[1]); if (option == OPT_HARD) { ret = link(source, dest); }if (option == OPT_HARD) { ... } else { ret = symlink(source, dest); }else { ... } if (ret != 0) { Jim_SetResultFormatted(interp, "error linking \"%#s\" to \"%#s\": %s", argv[0], argv[1], strerror(errno)); return JIM_ERR; }if (ret != 0) { ... } return JIM_OK; }file_cmd_link (Jim_Interp *interp, int argc, Jim_Obj *const *argv) { ... } /* ... */#endif static int file_stat(Jim_Interp *interp, Jim_Obj *filename, jim_stat_t *sb) { const char *path = Jim_String(filename); if (Jim_Stat(path, sb) == -1) { Jim_SetResultFormatted(interp, "could not read \"%#s\": %s", filename, strerror(errno)); return JIM_ERR; }if (Jim_Stat(path, sb) == -1) { ... } return JIM_OK; }{ ... } #ifdef HAVE_LSTAT static int file_lstat(Jim_Interp *interp, Jim_Obj *filename, jim_stat_t *sb) { const char *path = Jim_String(filename); if (lstat(path, sb) == -1) { Jim_SetResultFormatted(interp, "could not read \"%#s\": %s", filename, strerror(errno)); return JIM_ERR; }if (lstat(path, sb) == -1) { ... } return JIM_OK; }file_lstat (Jim_Interp *interp, Jim_Obj *filename, jim_stat_t *sb) { ... } /* ... */#else #define file_lstat file_stat #endif static int file_cmd_atime(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_stat_t sb; if (file_stat(interp, argv[0], &sb) != JIM_OK) { return JIM_ERR; }if (file_stat(interp, argv[0], &sb) != JIM_OK) { ... } Jim_SetResultInt(interp, sb.st_atime); return JIM_OK; }{ ... } /** * Set file atime/mtime to the given time in microseconds since the epoch. *//* ... */ static int JimSetFileTimes(Jim_Interp *interp, const char *filename, jim_wide us) { #ifdef HAVE_UTIMES struct timeval times[2]; times[1].tv_sec = times[0].tv_sec = us / 1000000; times[1].tv_usec = times[0].tv_usec = us % 1000000; if (utimes(filename, times) != 0) { Jim_SetResultFormatted(interp, "can't set time on \"%s\": %s", filename, strerror(errno)); return JIM_ERR; }if (utimes(filename, times) != 0) { ... } return JIM_OK;/* ... */ #else Jim_SetResultString(interp, "Not implemented", -1); return JIM_ERR;/* ... */ #endif }{ ... } static int file_cmd_mtime(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_stat_t sb; if (argc == 2) { jim_wide secs; if (Jim_GetWide(interp, argv[1], &secs) != JIM_OK) { return JIM_ERR; }if (Jim_GetWide(interp, argv[1], &secs) != JIM_OK) { ... } return JimSetFileTimes(interp, Jim_String(argv[0]), secs * 1000000); }if (argc == 2) { ... } if (file_stat(interp, argv[0], &sb) != JIM_OK) { return JIM_ERR; }if (file_stat(interp, argv[0], &sb) != JIM_OK) { ... } Jim_SetResultInt(interp, sb.st_mtime); return JIM_OK; }{ ... } #ifdef STAT_MTIME_US static int file_cmd_mtimeus(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_stat_t sb; if (argc == 2) { jim_wide us; if (Jim_GetWide(interp, argv[1], &us) != JIM_OK) { return JIM_ERR; }if (Jim_GetWide(interp, argv[1], &us) != JIM_OK) { ... } return JimSetFileTimes(interp, Jim_String(argv[0]), us); }if (argc == 2) { ... } if (file_stat(interp, argv[0], &sb) != JIM_OK) { return JIM_ERR; }if (file_stat(interp, argv[0], &sb) != JIM_OK) { ... } Jim_SetResultInt(interp, STAT_MTIME_US(sb)); return JIM_OK; }file_cmd_mtimeus (Jim_Interp *interp, int argc, Jim_Obj *const *argv) { ... } /* ... */#endif static int file_cmd_copy(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { return Jim_EvalPrefix(interp, "file copy", argc, argv); }{ ... } static int file_cmd_size(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_stat_t sb; if (file_stat(interp, argv[0], &sb) != JIM_OK) { return JIM_ERR; }if (file_stat(interp, argv[0], &sb) != JIM_OK) { ... } Jim_SetResultInt(interp, sb.st_size); return JIM_OK; }{ ... } static int file_cmd_isdirectory(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_stat_t sb; int ret = 0; if (file_stat(interp, argv[0], &sb) == JIM_OK) { ret = S_ISDIR(sb.st_mode); }if (file_stat(interp, argv[0], &sb) == JIM_OK) { ... } Jim_SetResultInt(interp, ret); return JIM_OK; }{ ... } static int file_cmd_isfile(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_stat_t sb; int ret = 0; if (file_stat(interp, argv[0], &sb) == JIM_OK) { ret = S_ISREG(sb.st_mode); }if (file_stat(interp, argv[0], &sb) == JIM_OK) { ... } Jim_SetResultInt(interp, ret); return JIM_OK; }{ ... } #ifdef HAVE_GETEUID static int file_cmd_owned(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_stat_t sb; int ret = 0; if (file_stat(interp, argv[0], &sb) == JIM_OK) { ret = (geteuid() == sb.st_uid); }if (file_stat(interp, argv[0], &sb) == JIM_OK) { ... } Jim_SetResultInt(interp, ret); return JIM_OK; }file_cmd_owned (Jim_Interp *interp, int argc, Jim_Obj *const *argv) { ... } /* ... */#endif #if defined(HAVE_READLINK) static int file_cmd_readlink(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { const char *path = Jim_String(argv[0]); char *linkValue = Jim_Alloc(MAXPATHLEN + 1); int linkLength = readlink(path, linkValue, MAXPATHLEN); if (linkLength == -1) { Jim_Free(linkValue); Jim_SetResultFormatted(interp, "could not read link \"%#s\": %s", argv[0], strerror(errno)); return JIM_ERR; }if (linkLength == -1) { ... } linkValue[linkLength] = 0; Jim_SetResult(interp, Jim_NewStringObjNoAlloc(interp, linkValue, linkLength)); return JIM_OK; }file_cmd_readlink (Jim_Interp *interp, int argc, Jim_Obj *const *argv) { ... } /* ... */#endif static int file_cmd_type(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_stat_t sb; if (file_lstat(interp, argv[0], &sb) != JIM_OK) { return JIM_ERR; }if (file_lstat(interp, argv[0], &sb) != JIM_OK) { ... } Jim_SetResultString(interp, JimGetFileType((int)sb.st_mode), -1); return JIM_OK; }{ ... } #ifdef HAVE_LSTAT static int file_cmd_lstat(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_stat_t sb; if (file_lstat(interp, argv[0], &sb) != JIM_OK) { return JIM_ERR; }if (file_lstat(interp, argv[0], &sb) != JIM_OK) { ... } return StoreStatData(interp, argc == 2 ? argv[1] : NULL, &sb); }file_cmd_lstat (Jim_Interp *interp, int argc, Jim_Obj *const *argv) { ... } /* ... */#else #define file_cmd_lstat file_cmd_stat #endif static int file_cmd_stat(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_stat_t sb; if (file_stat(interp, argv[0], &sb) != JIM_OK) { return JIM_ERR; }if (file_stat(interp, argv[0], &sb) != JIM_OK) { ... } return StoreStatData(interp, argc == 2 ? argv[1] : NULL, &sb); }{ ... } static const jim_subcmd_type file_command_table[] = { { "atime", "name", file_cmd_atime, 1, 1, /* Description: Last access time */ ...}, { "mtime", "name ?time?", file_cmd_mtime, 1, 2, /* Description: Get or set last modification time */ ...}, #ifdef STAT_MTIME_US { "mtimeus", "name ?time?", file_cmd_mtimeus, 1, 2, /* Description: Get or set last modification time in microseconds */ ...},/* ... */ #endif { "copy", "?-force? source dest", file_cmd_copy, 2, 3, /* Description: Copy source file to destination file */ ...}, { "dirname", "name", file_cmd_dirname, 1, 1, /* Description: Directory part of the name */ ...}, { "rootname", "name", file_cmd_rootname, 1, 1, /* Description: Name without any extension */ ...}, { "extension", "name", file_cmd_extension, 1, 1, /* Description: Last extension including the dot */ ...}, { "tail", "name", file_cmd_tail, 1, 1, /* Description: Last component of the name */ ...}, { "split", "name", file_cmd_split, 1, 1, /* Description: Split path into components as a list */ ...}, { "normalize", "name", file_cmd_normalize, 1, 1, /* Description: Normalized path of name */ ...}, { "join", "name ?name ...?", file_cmd_join, 1, -1, /* Description: Join multiple path components */ ...}, { "readable", "name", file_cmd_readable, 1, 1, /* Description: Is file readable */ ...}, { "writable", "name", file_cmd_writable, 1, 1, /* Description: Is file writable */ ...}, { "executable", "name", file_cmd_executable, 1, 1, /* Description: Is file executable */ ...}, { "exists", "name", file_cmd_exists, 1, 1, /* Description: Does file exist */ ...}, { "delete", "?-force|--? name ...", file_cmd_delete, 1, -1, /* Description: Deletes the files or directories (must be empty unless -force) */ ...}, { "mkdir", "dir ...", file_cmd_mkdir, 1, -1, /* Description: Creates the directories */ ...}, { "tempfile", "?template?", file_cmd_tempfile, 0, 1, /* Description: Creates a temporary filename */ ...}, { "rename", "?-force? source dest", file_cmd_rename, 2, 3, /* Description: Renames a file */ ...}, #if defined(HAVE_LINK) && defined(HAVE_SYMLINK) { "link", "?-symbolic|-hard? newname target", file_cmd_link, 2, 3, /* Description: Creates a hard or soft link */ }defined (HAVE_SYMLINK) { ... }, #endif #if defined(HAVE_READLINK) { "readlink", "name", file_cmd_readlink, 1, 1, /* Description: Value of the symbolic link */ }defined (HAVE_READLINK) { ... }, #endif { "size", "name", file_cmd_size, 1, 1, /* Description: Size of file */ ...}, { "stat", "name ?var?", file_cmd_stat, 1, 2, /* Description: Returns results of stat, and may store in var array */ ...}, { "lstat", "name ?var?", file_cmd_lstat, 1, 2, /* Description: Returns results of lstat, and may store in var array */ ...}, { "type", "name", file_cmd_type, 1, 1, /* Description: Returns type of the file */ ...}, #ifdef HAVE_GETEUID { "owned", "name", file_cmd_owned, 1, 1, /* Description: Returns 1 if owned by the current owner */ ...},/* ... */ #endif { "isdirectory", "name", file_cmd_isdirectory, 1, 1, /* Description: Returns 1 if name is a directory */ ...}, { "isfile", "name", file_cmd_isfile, 1, 1, /* Description: Returns 1 if name is a file */ ...}, { NULL ...} ...}; static int Jim_CdCmd(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { const char *path; if (argc != 2) { Jim_WrongNumArgs(interp, 1, argv, "dirname"); return JIM_ERR; }if (argc != 2) { ... } path = Jim_String(argv[1]); if (chdir(path) != 0) { Jim_SetResultFormatted(interp, "couldn't change working directory to \"%s\": %s", path, strerror(errno)); return JIM_ERR; }if (chdir(path) != 0) { ... } return JIM_OK; }{ ... } static int Jim_PwdCmd(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { char *cwd = Jim_Alloc(MAXPATHLEN); if (getcwd(cwd, MAXPATHLEN) == NULL) { Jim_SetResultString(interp, "Failed to get pwd", -1); Jim_Free(cwd); return JIM_ERR; }if (getcwd(cwd, MAXPATHLEN) == NULL) { ... } else if (ISWINDOWS) { /* Try to keep backslashes out of paths */ char *p = cwd; while ((p = strchr(p, '\\')) != NULL) { *p++ = '/'; }while ((p = strchr(p, '\\')) != NULL) { ... } }else if (ISWINDOWS) { ... } Jim_SetResultString(interp, cwd, -1); Jim_Free(cwd); return JIM_OK; }{ ... } int Jim_fileInit(Jim_Interp *interp) { Jim_PackageProvideCheck(interp, "file"); Jim_CreateCommand(interp, "file", Jim_SubCmdProc, (void *)file_command_table, NULL); Jim_CreateCommand(interp, "pwd", Jim_PwdCmd, NULL, NULL); Jim_CreateCommand(interp, "cd", Jim_CdCmd, NULL, NULL); return JIM_OK; }{ ... }
Details
Show:
from
Types: Columns:
Click anywhere in the source to view detailed information here...