----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Hi,

I think the problem is with the permissions.
You don't write what OS do you have.
The following info is true only for Linux.
You see your apache server runs as a user (probably nobody, check it in the
httpd.conf).
This means that the Jserv is running as the same user.
Now you have to be sure that the file in the htdocs directory is writable by
that user.
One quick (but ugly) solution is to give write premissions for that file for
everbody:
chmod 666 index.html.
Another is to change the owner of the file:
chown nobody:nobody index.html
     As a understood you know how do write into a file in Java but is not
working for you
(for the reasons mentioned above).
If not you can get a writer object like this:
PrintWriter pw=new PrintWriter( new
FileWriter("pathtohtdocs/index.html",true) );
/*true means append*/
pw.println("append this at the end");
pw.close();

p.s. In the future try to stay on topic(i.e.  Jserv) this question was more
appropriate
to ask at [EMAIL PROTECTED]

Hope it helps,

        Andras








----- Original Message -----
From: "Jeyasudha Rajendran" <[EMAIL PROTECTED]>
To: "Java Apache Users" <[EMAIL PROTECTED]>
Sent: Wednesday, August 16, 2000 4:07 PM
Subject: how to write data to a file


>
> Hi
> Can anyone help me in  writing to a data file stored in the apache
> server in the htdocs directory. I'm able to read the file stored in the
> htdocs directory but not able to append data to it.
> Thanks & Rgs
> jeyasudha
>
>
>




--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search Archives: 
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to