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 > macOS > function to test if file is open

function to test if file is open
Thread Tools
johnsonbryce
Fresh-Faced Recruit
Join Date: Mar 2006
Status: Offline
Reply With Quote
Mar 10, 2006, 10:48 AM
 
I need to write a function that will work in sh/ksh shell that will test to see if a file has already been opened for writting by another user

has anyone written something like this?

by the way - i don't have execute permissions on fuser and lsof not on system
     
whgoodman
Junior Member
Join Date: Jun 2005
Status: Offline
Reply With Quote
Mar 10, 2006, 12:23 PM
 
If you have the file descriptor number then this is a function built-in to ksh....

-t fildes
True, if file descriptor number fildes is open and associated
with a terminal device.
     
   
 
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:07 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.,