Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Unix and mac filebusy

Unix and mac filebusy
Thread Tools
clotje
Fresh-Faced Recruit
Join Date: Oct 1999
Status: Offline
Reply With Quote
Feb 19, 2001, 05:48 AM
 
Hi,

I like to know if there is a way to see if a mac file is busy. I try a make a unix script to move some files on an ethershare volume. I get some problems here, the unix script is moving the file when he is still copies from a mac desktop to the volume.

Is there a flag in the file or in the .rsrc?

Thanks
Claude
     
MacCanada
Junior Member
Join Date: Oct 1999
Location: Edmonton, Alberta, Canada
Status: Offline
Reply With Quote
Feb 19, 2001, 06:33 AM
 
Starting in AppleScript Version 1.4 there is now a new
'busy status' property has been added to the 'file information'
class by the 'info for' command

and it would be used as shown below:

tell application "Finder"
get busy status of (info for <yourfilepath here> )
end tell

it would either return 'true'

(yes the file's in use (open, or being copied)

or 'false'
(the file is presently closed)

to use it wrap a if/else statement around the checking ie ,
if it's not busy then copy else do this....

oh btw to get AppleScript's version:

display dialog "AppleScript Version " & (AppleScript's version as text) & " Is Installed." buttons {"OK"} default button 1 with icon 1

hope that helps
Cheers Matt

------------------
-- An idea is salvation by imagination.
-- Frank Lloyd Wright
-- 30 --
-- An idea is salvation by imagination.
-- Frank Lloyd Wright
-- 30 --
     
clotje  (op)
Fresh-Faced Recruit
Join Date: Oct 1999
Status: Offline
Reply With Quote
Feb 19, 2001, 10:17 AM
 
Thanks Matt,

But i know the Applescript way. But i like to know how to know if the mac file is busy at the Unix side.

Best regards,
Claude
     
Paul Crawford
Dedicated MacNNer
Join Date: Nov 1999
Location: Georgetown, Demerara, Guyana
Status: Offline
Reply With Quote
Mar 6, 2001, 05:35 PM
 
Hi Claude,

What Unix & shell are you using? (Bash, etc.) It's been a while since I used Unix much, but maybe I could help out...

Is it the case that the move command isn't returning the proper exit-code at all? Or, that the shell script isn't explicitly catching the exit-code, and you want to wait in a loop for the file to become available?

[P.S.: If you haven't already done so, you could also try asking the Unix gurus over in the OS X - Developer Forum.]

Regards,

--Paul

[This message has been edited by Paul Crawford (edited 03-06-2001).]
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 11:05 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,