D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG] redirects and C

 

I've seen and used this syntax:

$ prog < input.file > output.file

(but can't remember when or with which prog!)

Can 'prog' be given options in such a syntax?

$ prog --verbose < input.file > output.file
?

I'd like to see how it works in the source so if anyone knows of a program 
that can do this (and which is written in C), it would be handy!

Also any tips on enabling such input in a C program - I know how to do it in 
Perl, but in C is it just a case of opening STDIN with a filehandle?

Are there any special considerations compared to just opening a file that 
already exists on the filesystem?

(I'm using getline as a GNU extension to remove the need for a fixed size 
char* buffer to prevent buffer overflows).

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgpwaoMR6JAOR.pgp
Description: PGP signature