LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-23-2006, 12:21 AM   #1
shendeswanand
LQ Newbie
 
Registered: Dec 2005
Posts: 11

Rep: Reputation: 0
Unhappy count of files ?


Hi this is swanand.
I am doing a project in my college. It deals with the filesystem ext2 . I wanted to check if a file is been handled by my process only and that no other process is accessing that file. How could i do that ? Is there any way to be sure that no other process is handling that particular file at that moment?
I tried to check the count field in the inode,dentry,file objects, but all of them show 1, even when i have opened that file on different desktops in different editors ?????
Can you please help me out?
Thank you.
my e-mail address : swanandshende@yahoo.co.uk.
 
Old 01-23-2006, 12:28 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
See the man pages for fuser.
 
Old 01-23-2006, 12:39 AM   #3
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
what's up with the friggin huge-ass purple sh*t? I don't have a problem reading and neither do most people here. If you want to emphasize something, use the bb bold tag.
And putting your email address is useless and selfish.

you can also look at lsof.

Last edited by megaspaz; 01-23-2006 at 12:42 AM.
 
Old 01-23-2006, 02:51 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Never mind the e-mail address. If he wants to attract spam, that's his problem.
As for the purple stuff, I think it's forbidden (or at least discouraged) in the forum rules.
So we might report him to the moderators...
But then again, we've all been newbies at some point, so why bother.
I think he gets the message now.

As for his question, "lsof" and "fuser" are indeed the way to go.
If you want to forbid other processes from accessing files, do some research on file locking.
 
  


Reply



Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
count total number of lines in several files xushi Programming 5 11-12-2005 04:42 PM
how to get count of files in a directory? hongxing Linux - Software 2 11-10-2005 09:06 PM
how to count files disorderly Linux - Newbie 5 08-24-2004 01:36 PM
Should posts in general count on your post count? Joey.Dale General 16 01-27-2004 01:31 AM
dd: bs=2X , count=?X adam_boz Linux - General 3 10-27-2002 07:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration