[6125] in java-interest
Re: Simple File IO
daemon@ATHENA.MIT.EDU (Craig R. McClanahan)
Tue Mar 19 21:35:17 1996
Date: Tue, 19 Mar 1996 18:18:37 PST
Reply-To: Java Interest <JAVA-INTEREST@JAVASOFT.COM>
From: "Craig R. McClanahan" <crm@DAT.COM>
To: Multiple recipients of list JAVA-INTEREST
<JAVA-INTEREST@JAVASOFT.COM>
Life gets a little complicated when dealing with File I/O in a couple
of respects:
* The I/O classes only deal with local files on the client,
not remote files on the server.
* Even if you wanted to use just local files in an applet, this
would work under the applet viewer, but not under Netscape --
Netscape chose to disallow local file access when running
applets (although it should work fine for applications).
If you want to store stuff on the server instead, you might look at one of
the following approaches:
* Use the socket connection classes (java.net.*) to establish a
socket link between your applet and a server program running
on your host. This server program can be implemented in any
convenient language, as long as it can access the socket system
calls. This will require you to have some knowledge of network
programming -- I've seen lots of books in bookstores about this,
but don't have a name off the top of my head to recommend.
* If your applet simulated a user filling out and submitting a
form, and if you had a CGI program to accept that data and do
whatever you wished (such as store it on the server), you might
be able to meet your requirements without getting down and dirty
on socket level programming. You'll need to look in the Java
class library documentation for the classes to do this, or ask
on the list for some specific code samples.
Also, www.gamelan.com is a good source of examples for applets -- there is
a pretty extensive library of examples, documentation, and links to other
online resources.
At 09:10 PM 3/19/96 +0000, you wrote:
>> Hi. Does someone have an example that does simple file i/o?
>>I just want a client to be able to read in a file, and then update it,
>>over the network.
>>Can you do that with a regular http server, or do you need to make a java
>>server. I need network IO documentation!
>>
>>
>
>I have posted a couple of questions on File I/O and would be pleased to share
>with you any replies I get and I would appreciate it if you would do the same.
>
> Cheers, Alan.
>
>