• 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
File Busy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

File Busy


  • Subject: File Busy
  • From: Adam Bell <email@hidden>
  • Date: Sat, 15 Jul 2006 21:13:37 -0300

Title: File Busy
If you need to know that a file is already open, this works, but is very slow:

set thisFile to (choose file)
display dialog fileisOpen(POSIX path of thisFile)
on fileisOpen(this_file)
    try
        do shell script "/usr/sbin/lsof  " & quoted form of this_file
        return true
    on error
        return false
    end try
end fileisOpen
Jon's Commands "fileIsBusy"  uniformly returns false for the simple reason, I assume, that the "busy status" in the properties of a file remains "false" even if you attempt to change it to true (which does not cause an error) and when the file is open in another application.

I assume this is a bug unless I don't understand what "busy status" means.

Adam
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: File Busy
      • From: Jon Pugh <email@hidden>
  • Prev by Date: Re: scripting secure empty trash (was: no subject)
  • Next by Date: Re: scripting secure empty trash (was: no subject)
  • Previous by thread: AS "use rosetta"
  • Next by thread: Re: File Busy
  • Index(es):
    • Date
    • Thread