Redirecting stdout from XEV

This is a discussion on Redirecting stdout from XEV within the Linux Programming forums, part of the Platform Specific Boards category; As this application never returns (closes) I can't seem to get it to redirect it's output to a file xev ...

  1. #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.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,672
    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

  3. #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?

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,672
    > 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?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. redirecting stdout
    By ichijoji in forum C++ Programming
    Replies: 2
    Last Post: 08-15-2006, 09:20 PM
  2. Problems with switch()
    By duvernais28 in forum C Programming
    Replies: 13
    Last Post: 01-28-2005, 09:42 AM
  3. redirecting stdout
    By gregulator in forum C Programming
    Replies: 2
    Last Post: 04-22-2004, 10:07 AM
  4. redirecting stdout to a socket
    By Kinasz in forum Linux Programming
    Replies: 2
    Last Post: 03-25-2004, 07:01 AM
  5. redirecting stdout
    By Draco in forum C Programming
    Replies: 13
    Last Post: 10-11-2003, 12:56 AM

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