Sign in to follow this  
Followers 0
notta

File copy not copying entire file

5 posts in this topic

Hi, I'm having a problem with FileCopy. I have a very simple function that copies a text file to a remote share. The file seems to copy fine, but it's not copying the entire file. I was copying the file to a UNC path at first, but since that was not working I tried mapping the drive first and then copying the file. but still I receive the same result. I then used xcopy instead of the built in filecopy function, but again the same problem. If I drag and drop the file to the share it copies just fine. Do you guys have any thoughts why these copy methods are not copying the entire file?

The text file is 12.9 KB (13,271 bytes)

After copy is is 12.0 KB (12,288 bytes)

Any thoughts?

Share this post


Link to post
Share on other sites



FileCopy() works fine with valid UNC paths. You'll have to show us enough code to see how you were using it.

:graduated:


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

Share this post


Link to post
Share on other sites

Is the net share in NTFS compressed format ?

Have you tried copying the file to another local folder ? And then check the size ?

Rgds.


[s][font="Impact"]░▒▓▓►DrKovra◄▓▓▒░[/font][/s]The only thing I [sup]know [/sup]is that I don't know [sub]nothing[/sub]--------------- __________------------------------------ __________---------------

Share this post


Link to post
Share on other sites

The original file probably has an Alternate Data Stream. The drag and drop method in windows will copy the data stream along with the file, as long as the target file system supports it. AutoIt's FileCopy() and XCOPY do not copy the ADS along with the file.

Share this post


Link to post
Share on other sites

My bad guys. I iterate through a recordset writing the results to a file. After reaching EOF I then copy the file to a remote share. I wasn't closing the handle of the file and that was causing my issue. I don't understand why it copied anything at all then, but the issue is resolved. Thanks for the help though.

Share this post


Link to post
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
Sign in to follow this  
Followers 0