Re: Unixy question
Re: Unixy question
- Subject: Re: Unixy question
- From: garbanzito <email@hidden>
- Date: Thu, 9 May 2002 12:06:15 -0600
at 2002 05 08, 23:18 -0700, they whom i call Matthew Smith wrote:
This is not a command you can run with 'do shell script'. It is a
man page for a system call which can be accessed when writing C
programs. That's the reason you can't understand it. It descibes how
to use it in C.
yeah, one key to using man is to know which sections
(represented by numbers) contain shell commands and which
don't. man man should help with that.
it would be cool if AppleScript could do any unix system
call, but i suspect we'd have a really gnarly time bridging
the data structures.
instead, here's some bait for those who love to flame unix.
i deconstructed it from an example in the perl FAQ. it's my
first perl script ever:
-- get time with milliseconds from system
-- syscall.ph not present on default system, so 116 is from syscall.h in
-- /System/Library/Frameworks/Kernel.framework/Headers/sys/syscall.h
-- overhead is generally under 0.05 seconds on my G4/400
property gettimeofday : "116"
on finetime()
set the_script to "$time = pack(\"LL\", ());
syscall(" & gettimeofday & ", $time, 0);
@time = unpack(\"LL\", $time);
printf \"%.4f\\n\", $time[0] + $time[1] / 1_000_000;"
do shell script "perl -e '" & the_script & "'"
end finetime
--
steve harley email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.