Brian Stecher
|
Re: enum-devices output problem
|
Brian Stecher
12/01/2009 9:10 AM
post42942
|
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
|
|
|