notta Posted November 2, 2010 Share Posted November 2, 2010 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? Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 2, 2010 Share Posted November 2, 2010 FileCopy() works fine with valid UNC paths. You'll have to show us enough code to see how you were using it. 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 More sharing options...
DrKovra Posted November 2, 2010 Share Posted November 2, 2010 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]--------------- __________------------------------------ __________--------------- Link to comment Share on other sites More sharing options...
willichan Posted November 2, 2010 Share Posted November 2, 2010 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. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
notta Posted November 2, 2010 Author Share Posted November 2, 2010 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now