• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Checking on the existence of a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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!

-- 
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

  • Follow-Ups:
    • Re: Checking on the existence of a file
      • From: Shane Stanley <email@hidden>
References: 
 >Re: Checking on the existence of a file (From: Harald E Brandt <email@hidden>)

  • Prev by Date: Re: Single step Applescript app, or script
  • Next by Date: Re: Checking on the existence of a file
  • Previous by thread: Re: Checking on the existence of a file
  • Next by thread: Re: Checking on the existence of a file
  • Index(es):
    • Date
    • Thread