Jump to content
Sign in to follow this  
D4rk^S0ul

Strange problem with FileRead & FileOpen

Recommended Posts

D4rk^S0ul

For some reason when i try to use fileopen and fileread with a @directory it doesnt see it, this is code i got atm it simple i was using fileopen to check see to if it existed but it never was able to read the file, but if i just use the full path it read it.

Does anyone know why this is?

InetGet("http://*****************/check.ini", @TempDir & "\Check.ini", 0)


$FileR = FileRead(@TempDir & "\Check.ini")
If @error = 1 Then
    MsgBox(24, "Failed", "Failed to access internet, please check your firewall settings.")
    Exit
EndIf
If $FileR = "no" Then
    MsgBox(0, "Disabled", "This program has been disabled!")
EndIf

FileDelete(@TempDir & "\Check.ini")
Edited by D4rk^S0ul

Share this post


Link to post
Share on other sites
jvanegmond

$InetGetReturn = InetGet("http://*****************/check.ini", @TempDir & "\Check.ini", 0)

$FileExistsReturn = FileExists(@TempDir & "\Check.ini")
$FileReadReturn = FileRead(@TempDir & "\Check.ini")
$FileReadError = @error

#cs
If @error = 1 Then
    ;MsgBox(24, "Failed", "Failed to access internet, please check your firewall settings.")
    ;Exit
EndIf
If $FileR = "no" Then
    ;MsgBox(0, "Disabled", "This program has been disabled!")
EndIf
#ce

$FileDeleteReturn = FileDelete(@TempDir & "\Check.ini")

MsgBox(0, "End of Program - Debug data", "$InetGetReturn " & @TAB & $InetGetReturn & @LF & "$FileExistsReturn " & @TAB & $FileExistsReturn & @LF & "$FileReadReturn " & @TAB & $FileReadReturn & @LF & "$FileReadError " & @TAB & $FileReadError & @LF & "$FileDeleteReturn " & @TAB & $FileDeleteReturn)

Does this help?

Share this post


Link to post
Share on other sites
D4rk^S0ul

thx worked... Really strange i had almost the exact thing yet it never returned functions right...

Edited by D4rk^S0ul

Share this post


Link to post
Share on other sites
D4rk^S0ul

There seems to be a problem with Else function it never runs.

EDIT: NVM it turns out i was just using wrong code for msgbox

Edited by D4rk^S0ul

Share this post


Link to post
Share on other sites
jvanegmond

There seems to be a problem with Else function it never runs.

EDIT: NVM it turns out i was just using wrong code for msgbox

That would honestly be strange.. Suddenly, all if-else statements do not work anymore.. While not updating AutoIt or anything.. :(:shocked:

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  

×