PDA

View Full Version : Writing to text editors from C



gorded
November 21st, 2008, 11:45 PM
so i can open up nano/vim with

system("nano");

but how would i write to nano's stdin

Thanks

kknd
November 22nd, 2008, 12:27 AM
You can't write to a file and then open it in nano?

gorded
November 22nd, 2008, 02:23 AM
Yes but i would like the program to open nano and write to a file infront of the user (effect)

Mr.Macdonald
November 22nd, 2008, 04:51 AM
experiment with python or shell first, open nano in another terminal, and start writing to all the std* with python or shell, then you'll know

nitro_n2o
November 23rd, 2008, 01:32 AM
you could right something to file.. and in another shell have it do tail -f file

for example

touch hello.txt; tail -f hello.txt

then in another shell
echo "Hi" >> hello.txt

and see if that works