Jump to content

Recommended Posts

Posted

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.

Posted

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
Posted

$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.

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"

Posted

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.

Posted

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

"be smart, drink your wine"

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
×
×
  • Create New...