[5767] in java-interest

home help back first fref pref prev next nref lref last post

Re: Q> File Open And Read..Write ..Is Possible?

daemon@ATHENA.MIT.EDU (dc)
Mon Feb 26 05:00:34 1996

Date: Mon, 26 Feb 1996 00:28:14 -0800
To: "Sung-Jin,Kim" <gamestar@vision.nara.co.kr>
From: dc <dc@symbolicsoft.com>
Cc: java-interest@java.sun.com

Hi Gamestar -

Think you're right, its not possible to write directly to files from an
applet, but it is ok within a java application;

I have some code below that I tried in my applet, also gave the
'SecurityException' (or was it FileIOException?). So never got it to work;
try it in an application; there's probably other bugs, but at leat this is a
start ;-)


static public void diskout (String s)
	{
		DataOutput oput = null;
		
		try {
			oput = new DataOutputStream( new FileOutputStream("C:\testout") );
		} catch (IOException e)	{
			alert("couldn't create file output stream");
		}

		if (oput != null)	{
			try	{
				oput.writeBytes(s.toString() );
			} catch (IOException e)	{
				alert("couldn't write to file");
			} finally	{
			//	oput.close();
			}
		}

	}


'alert' basically brings up a dialog box, but that's another hack/story.

dc


At 12:36 PM 2/25/96 +0900, you wrote:
>Hi..! Javans..
>I am Studying Java Programming.
>It's Very Interesting Language.
>But, I have met severe problem.
>Is's File I/O.
>
>when I tried to open Some File And to read some bytes,
>The Applet make some message which is "Security ..."..
>so, I couldn't open file, read..ETC.
>
>Instead of Using Java, I am trying to use CGI to control file.
>
>I want to know, whether it is possible to control file in java,
>If It is possible, Please send some Source Code to me!!
>
>God Bless You.. From gamestar.          <2002 WorldCup In KOREA>
>
>-
>This message was sent to the java-interest mailing list
>Info: send 'help' to java-interest-request@java.sun.com
>
>-
>This message was sent to the java-interest mailing list
>Info: send 'help' to java-interest-request@java.sun.com
>
>
___________________________________________________________________

      /\    dave 'dc' collier
     /_/\     Symbolic Software, Inc.
    /_\_ \      dc@SymbolicSoft.com
   /___/__\       tel (415) 546 1295
 
         use your Head or lose your Mind!  http://www.BurnCycle.com
 


-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post