Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: writing to a named pipe (FIFO) fails



On 21-Nov-06, at 5:44 PM, Malcolm Fitzgerald wrote:
On 22/11/2006, at 12:32 AM, Cameron Hayne wrote:
I want to avoid the use of 'do shell script' for reasons of performance (each 'do shell script' seems to take about 0.1 second and in my AppleScript I will be doing thousands of writes to the named pipe).

In that case, tell us what you are trying to achieve.

I am trying to do profiling (measuring execution time on a per- statement basis) of AppleScript.
The time information available with vanilla AppleScript seems to be limited to one-second resolution whereas I need to measure times in the microsecond range. (There is an osax "GetMilliSec" that offers millisecond resolution but that isn't quite sufficient and I'd rather spare my users the need to install an osax if possible.)


Some people have reported success with the script I supplied (in my previous posting) but they were trying it without having previously set up a named pipe at the path indicated. (You set up a named pipe via the '/usr/bin/mkfifo' command and point a program at that path to handle the reads or writes to the named pipe. I.e. a named pipe is something that looks like a file but is actually an entrance to a currently running program.)

I was trying to use a named pipe since that would allow me to sidestep the above mentioned time limitations of AppleScript - I can capture the times to microsecond precision in the program that is listening at the named pipe and write them to a log file.

--
Cameron Hayne
email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >writing to a named pipe (FIFO) fails (From: Cameron Hayne <email@hidden>)
 >Re: writing to a named pipe (FIFO) fails (From: Malcolm Fitzgerald <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.