locutus243 Posted February 8, 2006 Share Posted February 8, 2006 Hiya guys, I've been at this problem for three hours now so I though it was time to hand over for some advice from the guru's. I'm using FileCopy but it isn't working properly. I think the reason is because the files which I am copying already exist, with the same name, in the destination folder. I thought that by setting the flag to 1 it would simply overwrite the current files but the copy doesn't seem to work and as far as I can tell from some testing its because its trying to copy files that are already there. I wondered if anybody else had experienced this problem or anybody knew a way round it other than simply setting the flag to 1???? Thanks Mark Link to comment Share on other sites More sharing options...
sksbir Posted February 8, 2006 Share Posted February 8, 2006 ......hellowhat about asking borgs ? ok, more seriously, the flag 1 is enough to overwrite existing files. I suggest you to check that:- you are trying to copy files (not directories or something else...)- you have read permission at source location.- you have write permission at destination location. Link to comment Share on other sites More sharing options...
locutus243 Posted February 8, 2006 Author Share Posted February 8, 2006 LOL, if only I could assimilate information like they do!!!! Anyways, below you'l see the lines of script, I'm using wildcards but pretty sure that I'm copying files. And I have both read and write permission because I can try it with a randomly named file and it works fine. Its just when I copy over these files where there is already a version present in the destination directory!! FileCopy("C:\EK HIERARCHY\errorlog\data\" & $time & "\*.*", "C:\EK HIERARCHY\errorlog\Subject\", 1) I've done some testing to find out what the problem could possibly be and the error only occurs when trying to write files that already exist in there. Thats why I think its a problem overwriting the files....but I dont see why??? Any help greatly appreciated Mark Link to comment Share on other sites More sharing options...
Nuffilein805 Posted February 8, 2006 Share Posted February 8, 2006 try FileCopy("C:\EK HIERARCHY\errorlog\data\" & $time & "\*.*", "C:\EK HIERARCHY\errorlog\Subject\*", 1) this should work or you can try FileCopy("C:\EK HIERARCHY\errorlog\data\" & $time & "\*.*", "C:\EK HIERARCHY\errorlog\Subject\*", 9) i tested both and they work my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
locutus243 Posted February 8, 2006 Author Share Posted February 8, 2006 Hey, I've tried both ways and neither is working. If they work on your computer then I assume the problem is something to do with the fail. But I can't for the life of me understand what because when I do the process manually then it works...I just have to dismiss a message box which says:-Confirm File ReplaceThis file already contains a read only file named 'pre_imp_item_importrejects.txt'Would you like to replace the existing file with this one?Yes Yes To All No CancelI don't know if this can shed any light on the problem???Thankyou for your continued effortsMark Link to comment Share on other sites More sharing options...
locutus243 Posted February 8, 2006 Author Share Posted February 8, 2006 Hiy Guys, After four hrs of banging my head on my desk I've finally figured out the problem. It seems that the script won't copy files that are read only??? I'm not sure why and I assumed I had both read and write access writes because I could copy them manually but obviously not. Anyways, thankyou for those of you that looked over my problem for me, I hope that others ca use this example to their benefit....I'm sure there must be people out there as stupid as me that need this kind of basic rubbish!!!!! Cheers guys Mark 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