Jump to content

FileGetSize not returning right values


Recommended Posts

Hello all,

Been programming with AutoIt for a few years now mostly for work, and have never really posted here. I have always been able to find answers by searching, but I can't find an answer to this though.

I am writing a program that downloads files / encrypts files / decrypts files. So I have alot of cases where I am reading or writing alot of data to the disk. I have created another .au3 that is compiled to monitor the transfer progress.

IE:

Main app runs progbar.exe like this:

$runPath = "progbar.exe " & $sourceFile & " " & $destFile
Run($runPath)

So this launches my progress bar app with command line parameters.

If $CmdLine[0] <> 0 Then
    $sourceFile = $CmdLine[1]
    $destFile = $CmdLine[2]
EndIf

The progbar.exe app takes these two file paths and runs FileGetSize on them. It then loops dividing the destination size by the source size and multiplying by 100 to get the percentage of the total file downloaded or processed.

The problem is, as soon as the FileCopy starts, the destination file is registered with windows as being full size. I'm assumbing that information is part of a header string for the files or something. (I haven't had any experience with this yet) So as soon as the file download starts, the progress bar shows complete.

I'm not sure what to do, as I don't know if there is any way of getting the 'actual' byte size and not what it is going to be when it's done.

Any help would be greatly appreciated!!

Vaughner

AutoIt3 3.3.0.0

SciTE4AutoIt3 Version 1.78

Please click me if you have a minute! Thanks!
Link to comment
Share on other sites

Man Jack, i've look for hours for that. In over 2 years, this is the first time I couldn't find something. :/

I should have realized that I needed to do the operation as binary, THANKS SO MUCH!!!

Please click me if you have a minute! Thanks!
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...