joybro
joybro

Reputation: 205

Why can't I "cat file > /dev/input/event"?

I'm playing with Linux input events and devices. I wrote a simple toy C program that opens /dev/input/event* and writes Linux multi-touch events to the opened file. It worked well and I was able to mimic customer's swipe event. (I know I can use evemu-* for this, but wanted to test with my own code).

But I found that if I try to write recorded events directly to the file in command line shell, it doesn't work with this error. Now I'm wondering why I can't write the events directly to the file. My toy program doesn't do anything special but open a file and write events to it. I think I should be able to do the same thing with cat and redirect. Am I doing something wrong in this command?

# cat ./swipe_events > /dev/input/event2
/system/bin/sh: cat: <stdout>: Invalid argument

Thanks,

Upvotes: 1

Views: 986

Answers (0)

Related Questions