I need to write a program that checks a directory every couple of seconds and if a text file has been dumped into it. If so this text file needs to be sent to the printer and printed out as hard copy.

What are the commands for sending a whole file / document to the printer. And is there a free ware program that already does this ( ie polling a named dir for documents to reprint ) after theres no point in reinventing the wheel.

Thanks