Erlang/OTP Forums

Author Message

<  Yaws mailing list  ~  Yaws: Output to file

hknight
Posted: Tue Feb 23, 2010 1:29 pm Reply with quote
User Joined: 07 Jan 2010 Posts: 11
The following Yaws code returns results to the web. Instead, I want
it to output the results to a text file named "output.txt"

<erl>
out(A) ->
Hdrs = A#arg.headers,
Other = Hdrs#headers.other,
{ehtml,
[
{item, [],
["Host: ",
{span, [], Hdrs#headers.host}]},
{item, [],
["IP Address: ",
{span, [], f("~p", [inet:peername(A#arg.clisock)])}]},
{item, [],
["Your user agent is: ",
{span, [], Hdrs#headers.user_agent}]},
{item, [],
["Accept-Charset: ",
{span, [],
f("~p", [yaws_api:parse_query(A)]) }]}
]}.
</erl>

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist
View user's profile Send private message
Guest
Posted: Tue Feb 23, 2010 3:32 pm Reply with quote
Guest
On Tue, Feb 23, 2010 at 7:57 AM, Hank Knight <hknight555@gmail.com (hknight555@gmail.com)> wrote:
Quote:
The following Yaws code returns results to the web.

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum