AIXThis forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hey guys,
How do I check if a file is opened/being used by another process/user in AIX?
Let's say, in one session I have a file opened via vi
% vi /home/user1/testfile.txt
Now in another session, let's say user2, how would they verify that the file /home/user1/testfile.txt is not opened/as being updated before doing anything to /home/user1/testfile.txt ????
From second session, I tried:
% fuser /home/user1/testfile.txt
and the results are coming back for both opened or not opened as:
/home/user1/testfile.txt:
Please help me to get to the correct answer.
Thanks in advance to everyone.
Nick.
Last edited by drnick911@yahoo.com; 01-13-2012 at 03:41 PM.
Hi,
I'm not quite sure but I think vi opens the file for reading and the saves it into temporary work file. Then the file is closed.
So you might not find your file open.
I'm not quite sure, but you should try another application to keep your file open.
I don't think vi has a swapfile variable to set...maybe wrong or maybe different versions, but not sure if this applies unless they installed vim manually...
Hey guys,
How do I check if a file is opened/being used by another process/user in AIX?
Let's say, in one session I have a file opened via vi
% vi /home/user1/testfile.txt
Now in another session, let's say user2, how would they verify that the file /home/user1/testfile.txt is not opened/as being updated before doing anything to /home/user1/testfile.txt ????
From second session, I tried:
% fuser /home/user1/testfile.txt
and the results are coming back for both opened or not opened as:
/home/user1/testfile.txt:
Please help me to get to the correct answer.
Thanks in advance to everyone.
Nick.
I think part of the problem may be that files like text files (and executables) are only open for a very short time while being loaded into memory.
Only if changed, do the contents get copied back to the original file (in ths scenario you describe), and again, the files are only open for a short time while writing back.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.