Sign in to follow this  
Followers 0
idle

Error with FileCopy

4 posts in this topic

I have made a script which moves some files from one dir to another, and checks the errorcode.

It works om my win2k machine, but when I was testing it on a win95 machine it failed to delete the file. I don't have a win95 machine mysqlf, so maybe someone could check if and see if its a bug?

FileCopy("c:\dir1\*.ted", "c:\dir2\*.*",1)

If @error = 0 then

FileDelete("*.ted")

Endif

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

FileCopy("c:\dir1\*.ted", "c:\dir2\*.*",1)
If @error = 0 then
FileDelete("*.ted")
Endif

should it be?:

FileCopy("c:\dir1\*.ted", "c:\dir2\*.*",1)
If @error = 0 then
FileDelete("c:\dir1\*.ted")
Endif

it might have been that the file was not executed in c:\dir1\

It worked fine on my Win95 machine.

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

As posted by JdeB on 12/8/03:

Just wanted to share with you that the filecopy returns its "returncode" into a variable .. not into @ERROR..

You are correct that Filecopy doesn't return a 1 if theres nothing to copy...don't know why.....thats for the developers to answer.


We have enough youth. How about a fountain of SMART?

Share this post


Link to post
Share on other sites

should it be?:

FileCopy("c:\dir1\*.ted", "c:\dir2\*.*",1)
If @error = 0 then
FileDelete("c:\dir1\*.ted")
Endif
You're right... Its me who have made a mastake.

I just haven't seen it, as the files in in the same dir on the machine on which i'm testing it...

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