Jump to content

file transfer progress...


Paradox
 Share

Recommended Posts

Weeeeeee!!!!!!!!!!! Well... as much as I appreciate the effort on this one, that won't do either. Take an actual RAR file and try the type command on it.. all that you get as your report is "Rar!" that's it...

I can see where you're going with this though, and I have to say that it's a great idea... the only limiting factor of it is what I just wrote... Type'ing out a compressed RAR file only gives you that as the return...

I think I'm screwed on this one... o:)

:lmao: Never, never, never give up! - Chruchill ;)

I tested with binaries, including a 164MB .iso file copied from a CIFS share to C:\Temp. Did you redirect to the destination file with '>'? Reading to the console will not display the contents, as you saw, but redirecting StdOut to a file should work and should get all non-printable binary content with it.

I've never used .rar files, so I'm looking for a way to generate a test file, then I'll try my test again.

Edit: Ok, feeling stupid now. I have 7-zip on all my Windoze boxes, and it does RAR.

Update: I packed my 164MB .iso image to a 123MB .rar file, and my script worked perfectly. Try it, you'll like it! :king:

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

:lmao: Never, never, never give up! - Chruchill ;)

I tested with binaries, including a 164MB .iso file copied from a CIFS share to C:\Temp. Did you redirect to the destination file with '>'? Reading to the console will not display the contents, as you saw, but redirecting StdOut to a file should work and should get all non-printable binary content with it.

I've never used .rar files, so I'm looking for a way to generate a test file, then I'll try my test again.

Edit: Ok, feeling stupid now. I have 7-zip on all my Windoze boxes, and it does RAR.

Update: I packed my 164MB .iso image to a 123MB .rar file, and my script worked perfectly. Try it, you'll like it! o:)

I modified it so that it matches what I'm already using for my variables and some procedures... This is the complete script. Gives me an error when I run it saying "Error: Unable to execute the external program" and that "The directory name is invalid"... Where the hell did I screw it up??? I'm so frustrated today... I'm at work, got some chick meeting up with me here in like 45 minutes, I'm nervous as hell, and I just don't think I have the patience for this today... ARGGHHHH!!!!

#include <guiconstants.au3>
#include <file.au3>

$file2transfer="\\jfritzsche\dbbases\compressed.rar"
$newfile="\\jfritzsche\dbbases\transferTest.rar"

$ProgGUI = GUICreate($File2transfer & " copy progress", 300, 80)
$ProgBar = GUICtrlCreateProgress(10, 10, 280, 25)
$ProgLabel = GUICtrlCreateLabel("Download is 0% complete...", 10, 45, 280, 25)

$SourceSize = FileGetSize($File2transfer); Get size of source file

$TypeCommand = "type " & $File2transfer & " > " & $newfile
Run(@ComSpec & " /c " & $TypeCommand, @SW_SHOW)

GUISetState(@SW_SHOW, $ProgGUI)
While (1)
Sleep(1000)
$DestSize = FileGetSize($newfile); Get size of destination file
If $DestSize = $SourceSize Then
GUIDelete($ProgGUI)
MsgBox(32, "File progress", "Download complete.")
ExitLoop
Else
$Progress = Int(($DestSize / $SourceSize) * 100)
GUICtrlSetData($ProgBar, $Progress)
GUICtrlSetData($ProgLabel, "Download is " & $Progress & "% complete...")
EndIf
WEnd

I'm doing this in a test file right now because I can't do the full test without another machine, so I'm using the same directory as the source, just changing the filename...

Link to comment
Share on other sites

I modified it so that it matches what I'm already using for my variables and some procedures... This is the complete script. Gives me an error when I run it saying "Error: Unable to execute the external program" and that "The directory name is invalid"... Where the hell did I screw it up??? I'm so frustrated today... I'm at work, got some chick meeting up with me here in like 45 minutes, I'm nervous as hell, and I just don't think I have the patience for this today... ARGGHHHH!!!!

CODE
#include <guiconstants.au3>

#include <file.au3>

$file2transfer="\\jfritzsche\dbbases\compressed.rar"

$newfile="\\jfritzsche\dbbases\transferTest.rar"

$ProgGUI = GUICreate($File2transfer & " copy progress", 300, 80)

$ProgBar = GUICtrlCreateProgress(10, 10, 280, 25)

$ProgLabel = GUICtrlCreateLabel("Download is 0% complete...", 10, 45, 280, 25)

$SourceSize = FileGetSize($File2transfer); Get size of source file

$TypeCommand = "type " & $File2transfer & " > " & $newfile

Run(@ComSpec & " /c " & $TypeCommand, @SW_SHOW)

GUISetState(@SW_SHOW, $ProgGUI)

While (1)

Sleep(1000)

$DestSize = FileGetSize($newfile); Get size of destination file

If $DestSize = $SourceSize Then

GUIDelete($ProgGUI)

MsgBox(32, "File progress", "Download complete.")

ExitLoop

Else

$Progress = Int(($DestSize / $SourceSize) * 100)

GUICtrlSetData($ProgBar, $Progress)

GUICtrlSetData($ProgLabel, "Download is " & $Progress & "% complete...")

EndIf

WEnd

I'm doing this in a test file right now because I can't do the full test without another machine, so I'm using the same directory as the source, just changing the filename...
You were SOOOoooo close! ;)

You dropped the working directory from the Run() line:

; Change the following line from:
; Run(@ComSpec & " /c " & $TypeCommand, @SW_SHOW)

; Change it to:
Run(@ComSpec & " /c " & $TypeCommand, @TempDir, @SW_SHOW)

Then it should work! :lmao:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...