#!/net/u/1/f/fdc/kermit/wermit + #!/p/kd/fdc/solaris9/wermit + # # Script jpginfo - produces a directory listing of JPG image files # showing size, date taken (if available), date modified, width, height, # P (portrait) or L (landscape), and the filename: # # Bytes Date taken......... Date modified.... Wide High Name # 294601 2004:06:19 11:11:44 20130907 17:23:17 555 740 P dscf0046-r.jpg # 17128 (not available) 20130907 17:23:18 120 160 P dscf0046-t.jpg # 670995 2004:06:19 11:11:44 20130805 15:39:51 960 1280 P dscf0046.jpg # 289297 2004:06:19 11:11:52 20130907 17:23:17 555 740 P dscf0047-r.jpg # 16779 (not available) 20130907 17:23:18 120 160 P dscf0047-t.jpg # 656833 2004:06:19 11:11:52 20130805 15:39:51 960 1280 P dscf0047.jpg # 279805 2004:06:19 11:15:08 20130907 17:23:16 555 740 P dscf0048-r.jpg # 18003 (not available) 20130907 17:23:17 120 160 P dscf0048-t.jpg # 647146 2004:06:19 11:15:08 20130805 15:39:52 960 1280 P dscf0048.jpg # # Illustrates: the \fpictureinfo() function, and the ARRAY LINK command. # The \&_[] array is the read-only command-line argument vector. # Usage: jpginfo [ file [ file [ file [ ... ] ] ] ] # # Requires C-Kermit 9.0.304 or later. # # Frank da Cruz, the Kermit Project, September 2013 if llt \v(version) 900304 exit 1 "FATAL - C-Kermit 9.0.304 or later required." .heading = " Bytes Date taken......... Date modified.... Wide High Name" if > \v(argc) 1 { # If names given on command line array link &a &_ # link array &a to the argument vector } else { # otherwise void \ffiles(*.jpg,&a) # generate file list in &a. } if not \fdim(&a) exit 1 No jpg files found. echo \m(heading) for i 1 \fdim(&a) 1 { .xx := \&a[i] if not equ "\fword(\m(xx),-1)" "jpg" continue xecho \flpad(\fsize(\m(xx)),9) .\%9 := \fpictureinfo(\m(xx),&d) if not def \&d[3] .\&d[3] = (not available) xecho \flpad(\&d[3],20) xecho \flpad(\fdate(\m(xx)),18) xecho \flpad(\&d[1],5) xecho \flpad(\&d[2],5) if == \%9 1 xecho " L " else if == \%9 2 xecho " P " else xecho " " echo \m(xx) } exit