Jump to content

Strange problem with FileRead & FileOpen


Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...