LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 03-30-2005, 10:14 AM   #1
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Rep: Reputation: 30
read /proc/net/dev with sscanf?


hiho@ll

i try to read the /proc/net/dev network device file with fgets and the use sscanf to save the elements to some variables

i tried sscanf(buff," %s:%ld %d %d ...",&interfacename,&receivedbytes,&receivedpackets,...);

the problem is that after receivedbytes every variable is 0
i think it's because of the spaces are depending on the size of the value i want to read
sometimes 2 spaces, sometimes 1 space sometimes more

anyone knows a workaround, or maybe i have false sscanf syntax, to (ignore) read more space characters?

thx@ll
 
  


Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
/proc/sys/net/ipv4/ip_local_port_range wetwet Linux - Networking 0 07-06-2004 09:47 AM
Question about /proc/net/devc alitrix Linux - Networking 0 02-23-2004 01:29 PM
/proc/net/wireless MarkusMan Linux - Wireless Networking 2 01-26-2004 10:56 PM
/dev and /proc Stephanie General 1 09-05-2002 09:44 AM
symbolic link: /dev/sound to /proc/asound/dev otterit Linux - General 3 08-08-2002 06:33 PM


All times are GMT -5. The time now is 06:03 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration