C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 02-25-2006, 04:23 AM   #1
Registered User
 
Join Date: Jan 2006
Posts: 62
Redirecting stdout from XEV

As this application never returns (closes) I can't seem to get it to redirect it's output to a file

xev > /tmp/file.txt

does not work...try it. It will create the file, but with no text inside. Any other idea's much appreciated.
3saul is offline   Reply With Quote
Old 02-25-2006, 05:12 AM   #2
and the hat of Jobseeking
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,665
Works for me
Code:
$ xev > tmp.txt
X connection to :0.0 broken (explicit kill or server shutdown).
$ ls -l tmp.txt
-rw-rw-r--  1 ??? ??? 18125 Feb 25 11:10 tmp.txt
Salem is offline   Reply With Quote
Old 02-27-2006, 11:36 PM   #3
Registered User
 
Join Date: Jan 2006
Posts: 62
Quote:
Originally Posted by Salem
Works for me
Code:
$ xev > tmp.txt
X connection to :0.0 broken (explicit kill or server shutdown).
$ ls -l tmp.txt
-rw-rw-r--  1 ??? ??? 18125 Feb 25 11:10 tmp.txt

OK yes it's working for me too now. The reason I thought it wasn't working was because it took so long before it would write the data to the text file. Is there anyway to force it to write immediately to the piped file?
3saul is offline   Reply With Quote
Old 02-28-2006, 02:22 AM   #4
and the hat of Jobseeking
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,665
> Is there anyway to force it to write immediately to the piped file?
If you use fork()/exec()/dup()/open() etc to manually create the process and the pipe, you should be able to make the pipe unbuffered.

But are you attempting to read that file with another process at the same time?
Salem is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
redirecting stdout ichijoji C++ Programming 2 08-15-2006 09:20 PM
Problems with switch() duvernais28 C Programming 13 01-28-2005 10:42 AM
redirecting stdout gregulator C Programming 2 04-22-2004 10:07 AM
redirecting stdout to a socket Kinasz Linux Programming 2 03-25-2004 08:01 AM
redirecting stdout Draco C Programming 13 10-11-2003 12:56 AM


All times are GMT -6. The time now is 04:33 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22