Jump to content
Sign in to follow this  
Proph

Preserve EOF?

Recommended Posts

Proph

I am trying to use IniRead IniWrite functions on my txtsetup.sif file to automate some file edits but it seems that autoit is getting rid of the EOF (End Of File) mark that is in the file. As far as I understand the EOF is very important. Does anyone know what I may be doing wrong? Or is this an autoit error?

Share this post


Link to post
Share on other sites
B3TA_SCR1PT3R

I am trying to use IniRead IniWrite functions on my txtsetup.sif file to automate some file edits but it seems that autoit is getting rid of the EOF (End Of File) mark that is in the file. As far as I understand the EOF is very important.  Does anyone know what I may be doing wrong? Or is this an autoit error?

<{POST_SNAPBACK}>

according to my calculations you dont need EOF but post some of your script so we can help you more..

[right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right]

Share this post


Link to post
Share on other sites
Westi

It seems your code is wrong.

This works

$var = IniReadSection("C:\TXTSETUP.SiF", "SourceDisksNames")
If @error Then 
    MsgBox(4096, "", "Error")
Else
    For $i = 1 To $var[0][0]
        MsgBox(4096, "", "Key: " & $var[$i][0] & @CRLF & "Value: " & $var[$i][1])
    Next
    IniWrite ( "C:\TXTSETUP.SiF", "SourceDisksNames", ";", "test" )
EndIf

Share this post


Link to post
Share on other sites
LxP
INIRead() and INIWrite() both use calls to Windows itself to get the job done. If INIWrite() removes the EOF character from the end of your file then you can be pretty confident that INIRead() will never complain about it.

Share this post


Link to post
Share on other sites
Proph

Maybe it has something to do with me using the Custom _iniread function?

If so... is there any way for me to re-create the EOF?

Share this post


Link to post
Share on other sites
LxP

All you would need to do is append Chr(26) to the end of the file in question. FileWrite() to the rescue!

Share this post


Link to post
Share on other sites
Proph

Thanks for the help LxP. :whistle:

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  

×