[REBOL] external apps with /core
From: warp::reboot::ch at: 16-Oct-2003 7:08
set-browser-path " "
shell: func [f [string!] /time t [integer!] /local r v][
if not time [t: 3]
v: back insert find/tail to-file s: now/time/precise #"." %_
browse rejoin [f " > " v]
until [any[r: none (third (now/time/precise - s)) > t all[attempt [r: read
v] not empty? r]]][]
attempt[delete v] r
]
example:
>> uptime: shell "uptime"
== { 4:16 up 2:24, 2 users, load averages: 0.27 0.30 0.31
}
>> bad: shell/time "jkhrwerjhawerja" 1
== none
..and if you have imagemagick (www.imagemagick.com) installed, this little
function will return an image size:
image-size: func ["file" f /local a r][
if error? try [
a: shell rejoin ["/usr/local/bin/identify " f]
if not empty? a [a: parse remove at a 1 " "]
r: to-pair copy/part a/3 find a/3 #"+"
][r: none]
r
]
example:
>> image-size %/Users/user/image.jpg
== 640x480
Will Arp
[warp--reboot--ch]
Librarian comment