Operating System - Linux
1829108 Members
12946 Online
109986 Solutions
New Discussion

What command, from C or Fortran languages, write directly in spool ?

 
Roxana_4
Frequent Advisor

What command, from C or Fortran languages, write directly in spool ?

My names is Roxana and I'am from Brasov, Romania.
I work on a HP-UX 11.23 system.
I would ike to know how could I list a spool from a program released in C language or Fortran language ?
What command exists in C language or Fortran languaje, for spool writing? With what command, from C or Fortran languages, could I write directly in spool ?

Thank you
an best regards.
3 REPLIES 3
Senthil Kumar .A_1
Honored Contributor

Re: What command, from C or Fortran languages, write directly in spool ?

Hi Roxana,

Did u mean, maintaing the command history ,by meaning spool. Could you eloborate more on your question.

Well technicality aside, from ur other question, u replied that you were new to HPUX and learning. This would explain why you are introducing urself in every thread. So, spare the introduction. Every one in here is "Learning and sharing" knowledge. so u are not alone. Feel at home, and a warm welcome. Please feel free to query any questions without qualms and jitteriness.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Arunvijai_4
Honored Contributor

Re: What command, from C or Fortran languages, write directly in spool ?

Hello,

Check this out, http://www.tldp.org/HOWTO/Printing-Usage-HOWTO-2.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
A. Clay Stephenson
Acclaimed Contributor

Re: What command, from C or Fortran languages, write directly in spool ?

You essentially have 2 choices:

1) use the system() function to invoke lp just as you would from the shell.

status = system("lp -dmyprinter myfile");

2) Write to a pipe:

FILE *f;

f = popen("lp -dmyprinter","w");
if (f != NULL)
{
(void) fprintf(f,"This is a test\n");
status = pclose(f);
}

Man system,popen,pclose for details.
If it ain't broke, I can fix that.