Sign in to follow this  
Followers 0
iceberg

java.policy

11 posts in this topic

hi guys,

wats the best possible way to edit a java.policy file?

i need to do a "filewrite"

thanks.


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites



What format is a java.policy file? JSON? I don't think there are any AutoIt functions created to deal with that format directly. What is normally used to edit a java.policy file?


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

wordpad


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

wordpad

FileRead()/FileWrite() don't work...? Is it Unicode? If so, you just have to use the latest version of AutoIt and some extra parameters.

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

yap it is in unicode. wat are the extra stuffs i need to add.

thanks.


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

yap it is in unicode. wat are the extra stuffs i need to add.

thanks.

AutoIt now supports Unicode, if you are running the current version. You just specify that by options when you do FileOpen().

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

$file = FileOpen("d:\java.policy", 128)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWriteLine($file, "Line1")
FileWriteLine($file, "Line2" & @CRLF)
FileWriteLine($file, "Line3")

FileClose($file)

i tried the open codes. when i output to a msgbox its fine...but i just cant get it to write some data into it...

i tried with 32 and 64 as well. same problems.


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

If you set FileOpen mode just as 128 or 64 or 32, it means file will be opened in read mode (0).

UTF8 (over)write mode would be 128+2

Edited by Siao

"be smart, drink your wine"

Share this post


Link to post
Share on other sites

thanks siao, i should have looked at the Help more carefully before posting.

ok, another thing is this......

#include <File.au3>

$file2 = FileOpen("d:\java.policy", 130)

; Check if file opened for writing OK
If $file2 = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

_FileWriteToLine($file2, 3, "my replacement for line 3", 1)

FileClose($file2)

Why doesnt my _FileWriteToLine work? thanks.


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

Because _FileWriteToLine doesn't support file handles, it takes filename and does FileOpen/FileClose automatically.


"be smart, drink your wine"

Share this post


Link to post
Share on other sites

alright...cool.


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0