AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

* Photo * Buckingham Canal - Near Chennai, INDIA
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Sun Apr 02, 2006 5:50 am    Post subject: Reply with quote

BoBo wrote:
Code:
RunWait, cmd /c Copy file1.jpg C:\temp,, Hide
RunWait, cmd /c Copy file2.jpg C:\temp,, Hide
Isn't that OK for you ?


Dear BoBo, Smile

I already tried this .. I am not sure what is happening.. But Windows notifies the DOS command that the file has been copied (well before it is fully copied!) and windows continues the "copy process" in background..

This works :

Code:
FileName = C:\image.dat
Target = C:\Temp

FileCopy, %FileName%, %Target%

Loop,
{
FileGetSize, UnUsedVar, %Target%\%FileName%
  If errorlevel = 0
     Break
}


The loop will not break until the file has been fully written.

BTW, I like the way you envision .. Very Happy

Thanks. Regards, Smile
_________________
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Sun Apr 02, 2006 6:37 am    Post subject: Reply with quote

Interesting trick. I suppose that if the file is copied, it is locked, so FileGetSize fails. I would add a small sleep in the loop to avoid slowing down the system (perhaps).

Somebody else has a similar problem (creating a PDF file) and I recommended to do a loop reading a few bytes with my binary reading routine, but now I will first recommand your method.

Otherwise, if you don't mind using a third party software, I think that XXCOPY or TotakCopy do the copy "by hand", so can reliably tell when the copy is over.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Sun Apr 02, 2006 1:26 pm    Post subject: Reply with quote

Dear PhiLho, Smile

Quote:
Interesting trick.


Credit: Serenity's post

Quote:
I suppose that if the file is copied, it is locked, so FileGetSize fails. I would add a small sleep in the loop to avoid slowing down the system (perhaps).


Good Info ... Thanks

Quote:
Somebody else has a similar problem (creating a PDF file) and I recommended to do a loop reading a few bytes with my binary reading routine, but now I will first recommand your method.


I request you to you write a FileCopy() command with your Binary Functions.

- We can have a nice Progress bar included.. (very useful for transferring Large files)
- We can have built-in support for CRC32

FileCopy("C:\Temp.Mpg","D:\Temp.Mpg") will copy and name the Target file something like
[CRC32-37ab425ef] Temp.mpg

Etcetera...

Quote:
Otherwise, if you don't mind using a third party software, I think that XXCOPY or TotakCopy do the copy "by hand", so can reliably tell when the copy is over.


XXCopy looks promising.. Yet to download & try it!

Regards, Smile
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group