Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-06-2006, 07:26 AM   #1
Registered: Nov 2004
Location: india
Distribution: Fedora core 1
Posts: 67

Rep: Reputation: 15
how to check that any /dev/ device file in use

I want to know that how can i check that any say /dev/lp0 or /dev/dsp is in use by any other program? So that i cannot use it in my program? I mean i want to have check condition that check whether some other process is accessing that device file
Old 04-07-2006, 01:35 PM   #2
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
/usr/sbin/lsof | grep '/dev'

--- rod.
Old 04-08-2006, 07:17 AM   #3
Registered: Nov 2004
Location: india
Distribution: Fedora core 1
Posts: 67

Original Poster
Rep: Reputation: 15


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
/dev/hdc1 contains a file system with errors, Check Forced mvrieze Slackware 5 01-10-2012 10:24 AM
startx --> (EE) xf86OpenSerial: Cannot open device /dev/input/mice No such device. TB2 Linux - Software 2 04-04-2007 05:11 PM
/dev/tty0, /dev/tty1, /dev/tty10...and so on...which should be used for a device ??? b0nd Slackware 2 04-02-2006 08:14 AM
/dev (file type: socket device?) blackzone Linux - Networking 1 08-10-2004 04:15 AM
mkraid output "[uEUEMMno MD device file in /dev" bruce1271 Linux - Software 6 03-21-2004 09:25 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:16 PM.

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