Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - enum-devices output problem: (3 Items)
   
enum-devices output problem  
I have a problem in QNX6.4.x with

#enum-devices -n > file.name

If output of enum-devices -n less than 1024 simbols - the file.name length is 0.

If output of enum-devices -n more than 1024 simbols - the file.name length is 1024.

Output is stop if I try ( for example )
#enum-devices -n | grep io-pkt

How can I resolve a problem and get full output of "enum-devices -n" in a text file or inside my program ?

Thank you.
Re: enum-devices output problem  
Because you've redirected stdout to a file, the printf()'s that enum-devices
use to output the information are being fully buffered, rather than line
buffered as when it outputs to the terminal. I'm guessing that there's
a bus that supports removable devices (e.g. USB) on your system so 
enum-devices will never terminate and you'll never get the tail end of
the buffered output flushed by the closing of the stream.

What you need to do is direct the output to something that the stream I/O
code in libc will treat as line buffered and then send that to a file
or whatever - for example, a psuedo-tty. You could use the "script" command
at the shell command prompt before running enum-devices. From code, checkout
the forkpty() or openpty() functions.

On Mon, Nov 30, 2009 at 11:36:21AM -0500, Leonid Khait wrote:
> I have a problem in QNX6.4.x with
> 
> #enum-devices -n > file.name
> 
> If output of enum-devices -n less than 1024 simbols - the file.name length is 0.
> 
> If output of enum-devices -n more than 1024 simbols - the file.name length is 1024.
> 
> Output is stop if I try ( for example )
> #enum-devices -n | grep io-pkt
> 
> How can I resolve a problem and get full output of "enum-devices -n" in a text file or inside my program ?
> 
> Thank you.
> 
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post42862
> 

-- 
Brian Stecher (bstecher@qnx.com)        QNX Software Systems
phone: +1 (613) 591-0931 (voice)        175 Terence Matthews Cr.
       +1 (613) 591-3579 (fax)          Kanata, Ontario, Canada K2M 1W8
Re: enum-devices output problem  
I release your's suggestion with  openpty()  and it work for me in QNX Momentics, but not work in my embeeded system. 

Which servises I need to start in embeeded system for properdevc-pty working ?

Actually I need to find and count all network card in my PC. How can I start
enum-devices to check them without enum-usb start?

I try:

#enum-devices -e pci  -n > file
#enum-devices -E pci  -n > file

but in file there are all drivers strings.

#enum-devices -n -c /etc/system/enum/devices/net -n > file

get me zero lengs file.

Thank you.