• 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: Emmanuel LEVY <email@hidden>
  • Date: Fri, 02 Nov 2012 01:40:08 +0100

FWIW, we do have to check existence of files several millions times a day, and sometimes in difficult conditions (for instance, we have to check from machine A the existence of a file which was just created on machine B by machine C).

The most reliable way we know uses ls:

theFileName is in (get paragraphs of (do shell script "ls " & quoted form of theFolderPath))

returns true if the file exists, false if it does not while the folder exists, and it fails if the folder does not exist.

Best,
Emmanuel


On Nov 2, 2012, at 12:44 AM, Shane Stanley wrote:

> On 02/11/2012, at 9:39 AM, Stan Cleveland <email@hidden> wrote:
>
>> Um, wouldn't that need to be a property?
>
> It could be, but it wouldn't have to be; that's really an implementation detail. The file system could be the implied container for files.
>
>> And how would a file that doesn't exist provide a result for that?
>
> You can create a «furl» for a file that doesn't exists.
>
> FWIW, in a perfect world I tend to agree with Chris. But the world of Finder and System Events scripting is so far from perfect, that asking them instead of using the alias trick is too much a matter of style over substance.
>
> --
> 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


 _______________________________________________
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: Ron Hunsinger <email@hidden>
References: 
 >Re: Checking on the existence of a file (From: Christopher Nebel <email@hidden>)
 >Re: Checking on the existence of a file (From: Shane Stanley <email@hidden>)
 >Re: Checking on the existence of a file (From: Stan Cleveland <email@hidden>)
 >Re: Checking on the existence of a file (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Checking on the existence of a file
  • Next by Date: Mail navigation script
  • 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