Results 1 to 7 of 7
I wonder about how can i take input from user write to a file then pass file content to /proc file.
For example my device file is DFILE under /dev,
...
- 01-05-2008 #1Just Joined!
- Join Date
- Dec 2005
- Posts
- 6
How can i pass content of a file to /proc/
I wonder about how can i take input from user write to a file then pass file content to /proc file.
For example my device file is DFILE under /dev,
user will enter
After that user will enterecho "this is my try" > /dev/DFILE
Then user should saw what we write.cat /proc/NEWD
Any idea?Last edited by gandil; 01-05-2008 at 09:58 AM. Reason: bad writing
- 01-05-2008 #2
That's not really what the /proc directory is for. For details on what it's for, go here.
What is it you ultimately want to do?--
Bill
Old age and treachery will overcome youth and skill.
- 01-05-2008 #3Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
You have to learn how to program a device driver, this is a useful link to a free book in pdf:
http://tldp.org/LDP/lkmpg/2.6/lkmpg.pdf
Chapter 5.2 discusses how to read and write to a proc file.
Regards
- 01-05-2008 #4
Franklin52, I had no idea. This is quite interesting. (I'm not a device driver kinda guy, not yet anyway.)
Thanks! :)--
Bill
Old age and treachery will overcome youth and skill.
- 01-12-2008 #5Just Joined!
- Join Date
- Dec 2005
- Posts
- 6
so how can i pass /dev/MYDEV information to /proc/MYDEVICE ?
- 01-13-2008 #6
The PDF that Franklin listed contains information on setting up a /dev entry and a /proc entry. Combine the two. This way, when the dev entry is written to, you store that into a buffer, and when the proc entry is read from, you output that buffer.
Easy peasy.DISTRO=Arch
Registered Linux User #388732
- 01-27-2008 #7Just Joined!
- Join Date
- Dec 2005
- Posts
- 6
thank you
thank you.


Reply With Quote