[ale] Excuse me for my web stupidity. Working on displaying output to a browser.
Chris Fowler
cfowler at outpostsentinel.com
Tue Jan 22 10:06:39 EST 2002
I want to excute a C program that is in cgi-bin directory of my thttpd server and have some output issues. I originally thought it would be with CR vs NL but now I'm not sure. I created this because I thought it would sove the
problem.
F
Exapmle program
int
main(int argc, char *argv[])
{
FILE *fp;
int c;
fp = popen("/sbin/stat", "r");
printf("<HTML><HEAD><TITLE>System Statistics</TITLE></HEAD><BODY>\n");
while(!feof(fp))
{
c = getc(fp);
if(c == 10)
{
putchar(10);
putchar(13);
}
else
putchar(c);
}
pclose(fp);
printf("</BODY></HTML>\n");
return 0;
}
First time I access http://IPADDRESS/cgi-bin/test Below is the output
*************************************************************** Linux version 2.4.13 (root at moses.outpostsentinel.com) (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)) #12 Wed Jan 16 14:35:42 EST 2002 BIOS-provided physical
RAM map: BIOS-e820: 0000000000000000 - 0000000000098000 (usable) BIOS-e820: 000000000009fc00 - 00000000000a0000 (usable) BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) BIOS-e820:
0000000000100000 - 0000000007d80000 (usable) BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved) On node 0 totalpages: 32128 zone(0): 4096 pages. zone(1): 28032 pages. zone(2): 0 pages. No local APIC
present or hardware disabled Kernel command line: auto BOOT_IMAGE=outpost ro root=107 ramdisk=16384 console=ttyS0,9600 Initializing CPU#0 Detected 300.684 MHz processor. Console: colour VGA+ 80x25 Calibrating delay
loop... 594.73 BogoMIPS Memory: 124000k/128512k available (809k kernel code, 4096k reserved, 211k data, 204k init, 0k highmem) Checking if this processor honours the WP bit even in supervisor mode... Ok. Dentry-cache
hash table entries: 16384 (order: 5, 131072 bytes) Inode-cache hash table entries: 8192 (order: 4, 65536 bytes) Mount-cache hash table entries: 2048 (order: 2, 16384 bytes) Buffer-cache hash table entries: 4096 (order: 2, 16384
bytes) Page-cache hash table entries: 32768 (order: 5, 131072 bytes) CPU: Before vendor init, caps: 00808131 01818131 00000000, vendor = 255 CPU: After vendor init, caps: 00808131 01818131 00000000 00000000 CPU:
After generic, caps: 00808131 01818131
Notice no CR's or NL
Now if I hit refresh here is the example output:
***************************************************************
Linux version 2.4.13 (root at moses.outpostsentinel.com) (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)) #12 Wed Jan 16 14:35:42 EST 2002
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 0000000000098000 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (usable)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 0000000007d80000 (usable)
BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
On node 0 totalpages: 32128
zone(0): 4096 pages.
Now I have both CR's and NL. Basically I have stat program that displays /proc info on command line. I want this to also be displayed on a web page to the users that needs to see this info without logging in.
Any help would be appreciated.
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
More information about the Ale
mailing list