Re: Checking on the existence of a file
Re: Checking on the existence of a file
- Subject: Re: Checking on the existence of a file
- From: Shane Stanley <email@hidden>
- Date: Sun, 02 Dec 2012 13:10:40 +1100
On 02/12/2012, at 5:27 AM, Harald E Brandt <email@hidden> wrote:
6. The ASObjC method:
set flag to current application's NSFileManager's defaultManager()'s fileExistsAtPath_(f) -- ~0.17 ms
So the clear winner is ASObjC in terms of speed and brevity!
I guess to be a fair comparison on both counts you should probably tack on "as boolean" -- although I suspect the effect will be negligible.
But performance is an area where ASObjC can really shine, particularly where you're just using pointers.
(But it does require ASObjC, so no plain vanilla.)
That depends on the definition of "vanilla", I suppose. If it means "requires nothing that is not part of a standard install", it's vanilla -- you can use it and save your script as a Cocoa-AppleScript app.
How these timings were done:
Short and sweet handler!
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden