Jump to content

filemove


 Share

Recommended Posts

Hi sorry, im making an autopathcer, it downloads files from the internet, puts them in a temp folder and then is supposed to move them to the correct ones.

except it doesnt work ...

this works.

filemove("ClientVer.dat", "lol/ClientVer.dat", 9)

this doesnt,

filemove("ClientVer.dat", "lol/second/ClientVer.dat", 9)

$dest = "lol/second/ClientVer.dat"

$src = "ClientVer.dat"

doesnt work...

filemove($src, $dest, 9)

could anyone explain to me why?

;updater

#AutoIt3Wrapper_plugin_funcs = MD5Hash

if NOT fileexists("updater\MD5Hash.dll") then
    msgbox(0, "Missing files", "Certain files have been removed, altered or are missing, please reinstall or repatch", 5)
    exit
EndIf

$md5plugin = PluginOpen("updater\MD5Hash.dll")


$downloadUrl = "http://pyramids.hopto.org/updater/"

$filelist = InetGet($downloadUrl & "file.list", "file.list" , 1, 0)

if Not $filelist then 
    msgbox(0, "Server Offline", "Update-server is offline")
    Exit
EndIf

$fileHandle = fileOpen("file.list", 0)

if not $fileHandle then 
    msgbox(0, "File error", "Update file couldn't be found")
    Exit
EndIf

$line = 1

$lineContent = FileReadLine($fileHandle, $line)

while not @error 
    
$splitString    = stringsplit($lineContent, ",", 1)
$unsplitFile    = $splitString[1]
$splitFile      = stringsplit($unsplitFile, "./", 1)

$fullfile       = $splitFile[2]
$filedelimit    = stringsplit($fullfile, "/", 1)

$filename       = $filedelimit[$filedelimit[0]]
$md5            = $splitString[2]

$fullfilepath   = stringsplit($fullfile, $filename, 1)
$filepath       = $fullfilepath[1]

    


if not fileexists($fullfile) then 
    TrayTip("Downloading", $filename & "   " & (inetgetsize($downloadUrl & $fullfile) / 8000) & " kb", 10, 16)
    inetget($downloadUrl & $fullfile, $filename, 1, 0)
    filemove("ClientVer.dat", "lol/second/ClientVer.dat", 9); <-------------------------------------------------------- same result, doesnt work

      ; through all the stringsplits, filename ends up with ClientVar.dat and fullfile containts the full dir + filename where it should be put
      ; so data/npc/.......
       filemove($filename, $fullfile, 9); <------------------------------------------------------------------------------------ same result, doesnt work
EndIf

$line = $line + 1
$lineContent = FileReadLine($fileHandle, $line)
wend
Edited by Drchubby
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...